mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-29 21:57:42 -05:00
Decompile 26 more callees; clear six asm files entirely
Twenty-six functions across twelve groups, each group chosen so it clears a
.s file's head or the whole file, never splitting one:
asm/overlay_29_0231EDFC.s TryHurl
asm/overlay_29_0230E064.s TryRecruit
asm/overlay_29_0234B130.s ov29_0234B130, ov29_0234B1A4,
LogMessageByIdWithPopupCheckParticipants,
WaitUntilAlertBoxTextIsLoadedWrapper,
LogMessageByIdWithPopupCheckUser,
LogMessageWithPopupCheckUser, LogMessageByIdQuiet
asm/overlay_29_0231B1B8.s TryActivateBadDreams
asm/overlay_29_02301D84.s OtherMonsterAbilityIsActive
asm/main_02050300.s SetItemAcquired
asm/overlay_29_0230F9A4.s ov29_0230F9A4, TrySpawnEnemyItemDrop
asm/main_02051504.s RetrieveFromItemList1, IsForbiddenFloor
asm/main_020251F0.s sub_020251F0, StrncpySimpleNoPadSafe
asm/main_020261F4.s sub_020261F4, sub_02026204, DrawTextInWindow
asm/main_0202B568.s sub_0202B568, GetSimpleMenuResult__0202B870
asm/main_020022C4.s sub_020022C4, sub_020022D0, RandIntSafe
Fourteen are callees of the ten previously landed functions; the rest are the
neighbours that had to clear first to reach a file boundary. Six .s files are
consumed entirely, so main.lsf loses six asm objects and gains six tails.
Thirty-five call-site declarations are replaced by an include of the owning
header, across twenty-one files. Several were not duplicates but genuine
disagreements: GetSimpleMenuResult__0202B870 had five declarations, all giving
the window id as s8 against the definition's s32; two were K&R
`extern int ov29_0234B1A4();`. None of these can surface in a build, since two
declarations in two translation units never meet.
A declaration that disagrees is NOT automatically stale. src/overlay_13_0238BDA8.c
keeps its own `extern void DrawTextInWindow(s8 window_id, ...)`: that file's
DrawPersonalityTestDebug carries the window id in an s8 local, and against the
header's s32 the call needs a sign extension retail does not emit. Replacing it
broke OVY_13.sbin. Retail's translation units genuinely disagreed about this
prototype, so the per-TU declaration is evidence, not a defect to tidy away.
Three shared types change, all layout-preserving:
* struct team_member's first byte, a 1+7 bitfield pair, becomes u8 flags.
TryRecruit writes the whole byte in one strb and reads bit 0 through
GetFlag(u8, u8), which takes a value a bitfield member cannot supply.
* struct unk_02026130's field_0x4 grows from [4] to [0x118] (total 0x11C).
DrawTextInWindow declares one as a local, so its size sets the frame.
* alert_box_info::alert_box_window_id becomes s8; it holds -2, and seven
ldrsb reads of offset 0xCEC corroborate the signedness.
sub_02026194 is corrected from one argument to three: sub_02020BC4 reads r1
and r2 (tst r1, #0x400; strh r1, [r4, #0x60]; str r2, [r4, #0x88]) and every
asm caller passes all three, so the wrapper was forwarding registers it never
named. Its pre-landing asm was recovered from git and both forms measured.
Authored by Claude (Opus 5) under human direction. Each function was measured
at decomp.me score 0 in all three regions and re-measured by an independent
verifier. Confirmed by matching builds of all three regions:
build/pmdsky.us/pmdsky.us.nds: OK, build/pmdsky.eu/pmdsky.eu.nds: OK,
build/pmdsky.jp/pmdsky.jp.nds: OK.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
#pragma once
|
||||
.public _020AFD04
|
||||
.public AnalyzeText
|
||||
.public DrawChar
|
||||
.public GetColorCodePaletteOffset
|
||||
.public PreprocessStringFromId
|
||||
.public _020AFD04
|
||||
.public sub_02020B4C
|
||||
.public sub_02020B60
|
||||
.public sub_02020B74
|
||||
.public sub_02020B94
|
||||
.public sub_02020BC4
|
||||
.public sub_02020D7C
|
||||
.public sub_02022118
|
||||
.public sub_02025C7C
|
||||
.public sub_02025E84
|
||||
@@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
.public GetMaxItemsOnPage
|
||||
.public GetNumItemsOnPage
|
||||
.public GetPageItemYOffset
|
||||
.public GetPageStart
|
||||
.public GetSelectedMenuItemIdx
|
||||
.public GetTotalNumMenuItems
|
||||
.public GetWindowContents
|
||||
.public IsMenuOptionActive
|
||||
.public PlayWindowInputSound
|
||||
.public UpdateWindow
|
||||
.public sub_020263C8
|
||||
.public sub_02027B1C
|
||||
.public sub_0202810C
|
||||
@@ -23,4 +21,3 @@
|
||||
.public sub_0203250C
|
||||
.public sub_02032684
|
||||
.public sub_02033758
|
||||
.public UpdateWindow
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
.public ADVENTURE_LOG_PTR
|
||||
.public GetAdventureLogCompleted
|
||||
.public IsItemValidVeneer
|
||||
.public NormalizeTreasureBox
|
||||
.public SetAdventureLogCompleted
|
||||
.public SetResolvedPerformanceProgressFlag
|
||||
@@ -1,10 +1,8 @@
|
||||
#pragma once
|
||||
.public _020A1864
|
||||
.public CopyBitsFrom
|
||||
.public CopyBitsTo
|
||||
.public DUNGEON_RESTRICTIONS
|
||||
.public DungeonFloorToGroupFloor
|
||||
.public GetItemIdFromList
|
||||
.public GetNbFloorsPlusOne
|
||||
.public MISSION_FLOORS_FORBIDDEN
|
||||
.public RandIntSafe
|
||||
.public _020A1864
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
.public DefenderAbilityIsActive__02301A0C
|
||||
.public DUNGEON_PTR
|
||||
.public EntityIsValid__023000E4
|
||||
.public ShouldTreatMonsterAsAlly
|
||||
@@ -1,57 +0,0 @@
|
||||
#pragma once
|
||||
.public abs
|
||||
.public CanSeeTarget
|
||||
.public ChangeMonsterAnimationToIdle
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonModeSetupAndShowNameKeyboard
|
||||
.public EnableAllLearnableIqSkills
|
||||
.public EnsureCanStandCurrentTile
|
||||
.public GetActiveTeamMember
|
||||
.public GetDirectionTowardsPosition
|
||||
.public GetMessageLogPreprocessorArgs
|
||||
.public GetNameString
|
||||
.public GetRecoloredNameOfTeamMemberAtIdx
|
||||
.public GetRecoloredTeamMemberName
|
||||
.public HandleFaint
|
||||
.public InitTeamMember
|
||||
.public IsMonsterOnTeam
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public MonsterIsType
|
||||
.public ov10_022C4410
|
||||
.public ov10_022C441C
|
||||
.public ov10_022C443C
|
||||
.public ov10_022C447C
|
||||
.public ov10_022C44FC
|
||||
.public ov10_022C46FC
|
||||
.public ov10_022C4700
|
||||
.public ov10_022C4704
|
||||
.public ov10_022C4708
|
||||
.public ov10_022C470C
|
||||
.public ov29_022E1B28
|
||||
.public ov29_022E68BC
|
||||
.public ov29_022E8104
|
||||
.public ov29_022E81F8
|
||||
.public ov29_022EACAC
|
||||
.public ov29_02305F60
|
||||
.public ov29_0230E5A8
|
||||
.public ov29_0230E5FC
|
||||
.public ov29_0230E658
|
||||
.public ov29_0234B1A4
|
||||
.public ov29_0234D630
|
||||
.public ov29_0234D7C0
|
||||
.public ov29_0234D838
|
||||
.public ov29_0234D8A0
|
||||
.public ov29_0234EE10
|
||||
.public RECRUITMENT_LEVEL_BOOST_TABLE
|
||||
.public RemoveMonsterFromTile
|
||||
.public SetMessageLogPreprocessorArgsString
|
||||
.public SetPokemonJoined
|
||||
.public SetPreprocessorArgsIdVal
|
||||
.public SetPreprocessorArgsStringToName
|
||||
.public SpecificRecruitCheck
|
||||
.public StrcpySimple
|
||||
.public StrncpyName
|
||||
.public StrncpySimpleNoPad
|
||||
.public sub_02056698
|
||||
.public SubstitutePlaceholderStringTags
|
||||
.public WaitUntilAlertBoxPauseIsOver
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
.public AbilityIsActiveVeneer
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonRandOutcome__022EAB20
|
||||
.public ExclusiveItemEffectIsActive__0230F8AC
|
||||
.public GenerateStandardItem
|
||||
.public IqSkillIsEnabled
|
||||
.public IsMonster__0230F980
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public SpawnDroppedItemWrapper
|
||||
.public SubstitutePlaceholderStringTags
|
||||
.public TreasureBoxDropsEnabled
|
||||
.public TryGenerateUnownStoneDrop
|
||||
.public ov10_022C4650
|
||||
.public ov29_02344B9C
|
||||
.public ov29_023460DC
|
||||
.public ov29_02347184
|
||||
.public ov29_0234908C
|
||||
.public ov29_023529A8
|
||||
6
asm/include/overlay_29_0230FB30.inc
Normal file
6
asm/include/overlay_29_0230FB30.inc
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public SubstitutePlaceholderStringTags
|
||||
.public ov29_02344B9C
|
||||
.public ov29_02347184
|
||||
.public ov29_023529A8
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
.public ApplyDamageAndEffectsWrapper
|
||||
.public DUNGEON_PTR
|
||||
.public EntityIsValid__0231B194
|
||||
.public IsMonster__0231B318
|
||||
.public IsMonsterSleeping
|
||||
.public IsValidTargetEntity
|
||||
.public ov10_022C4530
|
||||
.public SetPreprocessorArgsIdVal
|
||||
.public TryEndPetrifiedOrSleepStatus
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
.public _s32_div_f
|
||||
.public AbilityIsActiveVeneer
|
||||
.public AdvanceFrame
|
||||
.public CalcDamageFixedNoCategory
|
||||
.public CannotMoveToTile
|
||||
.public CanSeeTarget
|
||||
.public ChangeMonsterAnimation
|
||||
.public ChangeMonsterAnimationToIdle
|
||||
.public DIRECTIONS_XY
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandRange
|
||||
.public EntityIsValid__0231F570
|
||||
.public GetDirectionTowardsPosition
|
||||
.public GetTile
|
||||
.public GetTreatmentBetweenMonsters
|
||||
.public HasDropeyeStatus
|
||||
.public HURL_DAMAGE
|
||||
.public InitMove
|
||||
.public LogMessageByIdWithPopupCheckUserTarget
|
||||
.public MoveMonsterToPos
|
||||
.public ov29_022E9298
|
||||
.public ov29_022EA370
|
||||
.public ov29_0232033C
|
||||
.public ov29_02321238
|
||||
.public PlaySeByIdIfNotSilence
|
||||
.public ShouldDisplayEntityWrapper
|
||||
.public SinAbs4096
|
||||
.public SubstitutePlaceholderStringTags
|
||||
.public TryWarp
|
||||
.public TwoTurnMoveForcedMiss
|
||||
.public UpdateEntityPixelPos
|
||||
@@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
.public AdvanceFrame
|
||||
.public FullyCloseAlertBox
|
||||
.public InitPreprocessorArgs
|
||||
.public LogMessage
|
||||
.public LogMessageByIdWithPopupCheckUserTarget
|
||||
.public MESSAGE_LOG_INFO
|
||||
.public ov29_022E9FC0
|
||||
.public ShouldDisplayEntityWrapper
|
||||
.public StringFromId
|
||||
.public UnkMapRelatedFunc
|
||||
.public WaitUntilAlertBoxTextIsLoaded
|
||||
@@ -1,42 +1,8 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_020022C4.inc"
|
||||
.include "main_02002318.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start sub_020022C4
|
||||
sub_020022C4: ; 0x020022C4
|
||||
mov r1, #1
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
arm_func_end sub_020022C4
|
||||
|
||||
arm_func_start sub_020022D0
|
||||
sub_020022D0: ; 0x020022D0
|
||||
ldr r3, [r0]
|
||||
ldr r2, _020022F4 ; =0x5D588B65
|
||||
mul r2, r3, r2
|
||||
add r3, r2, #1
|
||||
mov r2, r3, lsr #0x10
|
||||
mul r1, r2, r1
|
||||
str r3, [r0]
|
||||
mov r0, r1, lsr #0x10
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020022F4: .word 0x5D588B65
|
||||
arm_func_end sub_020022D0
|
||||
|
||||
arm_func_start RandIntSafe
|
||||
RandIntSafe: ; 0x020022F8
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
bl Rand16Bit
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r1, r0, lsr #0x10
|
||||
mul r0, r1, r4
|
||||
mov r0, r0, asr #0x10
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end RandIntSafe
|
||||
|
||||
arm_func_start RandRangeSafe
|
||||
RandRangeSafe: ; 0x02002318
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
@@ -1,75 +1,8 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_020251F0.inc"
|
||||
.include "main_02025230.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start sub_020251F0
|
||||
sub_020251F0: ; 0x020251F0
|
||||
#ifdef JAPAN
|
||||
ldr r1, _02025264 ; =_020B112C_JP
|
||||
ldr r1, [r1, #4]
|
||||
add r2, r1, r0, lsl #1
|
||||
ldrb r1, [r1, r0, lsl #1]
|
||||
ldrb r0, [r2, #1]
|
||||
add r0, r0, r1, lsl #8
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02025264: .word _020B112C_JP
|
||||
#else
|
||||
bx lr
|
||||
#endif
|
||||
arm_func_end sub_020251F0
|
||||
|
||||
arm_func_start StrncpySimpleNoPadSafe
|
||||
StrncpySimpleNoPadSafe: ; 0x020251F4
|
||||
#ifdef JAPAN
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r6, r0
|
||||
mov r5, r1
|
||||
mov r4, r2
|
||||
b _02025294
|
||||
_0202527C:
|
||||
ldrb r0, [r5], #1
|
||||
bl sub_020251F0
|
||||
mov r1, r0, asr #8
|
||||
strb r1, [r6]
|
||||
strb r0, [r6, #1]
|
||||
add r6, r6, #2
|
||||
_02025294:
|
||||
cmp r4, #0
|
||||
sub r4, r4, #1
|
||||
ble _020252AC
|
||||
ldrb r0, [r5]
|
||||
cmp r0, #0
|
||||
bne _0202527C
|
||||
_020252AC:
|
||||
mov r0, #0
|
||||
strb r0, [r6]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
#else
|
||||
mov ip, #0x20
|
||||
b _0202520C
|
||||
_020251FC:
|
||||
ldrb r3, [r1], #1
|
||||
cmp r3, #0x100
|
||||
strlob r3, [r0], #1
|
||||
strhsb ip, [r0], #1
|
||||
_0202520C:
|
||||
cmp r2, #0
|
||||
sub r2, r2, #1
|
||||
ble _02025224
|
||||
ldrb r3, [r1]
|
||||
cmp r3, #0
|
||||
bne _020251FC
|
||||
_02025224:
|
||||
mov r1, #0
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
#endif
|
||||
arm_func_end StrncpySimpleNoPadSafe
|
||||
|
||||
arm_func_start StrcpyName
|
||||
StrcpyName: ; 0x02025230
|
||||
#ifdef JAPAN
|
||||
@@ -1,52 +1,8 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_020261F4.inc"
|
||||
.include "main_02026268.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start sub_020261F4
|
||||
sub_020261F4: ; 0x020261F4
|
||||
ldr ip, _02026200 ; =sub_02020D7C
|
||||
add r0, r0, #4
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_02026200: .word sub_02020D7C
|
||||
arm_func_end sub_020261F4
|
||||
|
||||
arm_func_start sub_02026204
|
||||
sub_02026204: ; 0x02026204
|
||||
ldr ip, _02026210 ; =AnalyzeText
|
||||
add r0, r0, #4
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_02026210: .word AnalyzeText
|
||||
arm_func_end sub_02026204
|
||||
|
||||
arm_func_start DrawTextInWindow
|
||||
DrawTextInWindow: ; 0x02026214
|
||||
stmdb sp!, {r3, r4, lr}
|
||||
sub sp, sp, #0x124
|
||||
mov r4, r0
|
||||
str r1, [sp]
|
||||
mov r1, r4
|
||||
add r0, sp, #8
|
||||
mov r4, r3
|
||||
str r2, [sp, #4]
|
||||
bl sub_02025E84
|
||||
add r0, sp, #0xc
|
||||
add r1, sp, #0
|
||||
bl sub_02020B60
|
||||
ldr r1, _02026264 ; =0x0000C402
|
||||
add r0, sp, #0xc
|
||||
mov r2, r4
|
||||
bl sub_02020BC4
|
||||
add r0, sp, #0xc
|
||||
bl AnalyzeText
|
||||
add sp, sp, #0x124
|
||||
ldmia sp!, {r3, r4, pc}
|
||||
.align 2, 0
|
||||
_02026264: .word 0x0000C402
|
||||
arm_func_end DrawTextInWindow
|
||||
|
||||
arm_func_start AppendStandardStringToMission
|
||||
AppendStandardStringToMission: ; 0x02026268
|
||||
stmdb sp!, {r4, lr}
|
||||
@@ -1,43 +1,8 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_0202B568.inc"
|
||||
.include "main_0202B5C8.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start sub_0202B568
|
||||
sub_0202B568: ; 0x0202B568
|
||||
stmdb sp!, {r3, lr}
|
||||
bl GetWindowContents
|
||||
add r0, r0, #4
|
||||
bl GetMaxItemsOnPage
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end sub_0202B568
|
||||
|
||||
arm_func_start GetSimpleMenuResult__0202B870
|
||||
GetSimpleMenuResult__0202B870: ; 0x0202B57C
|
||||
stmdb sp!, {r4, lr}
|
||||
bl GetWindowContents
|
||||
ldrb r1, [r0, #0x1a0]
|
||||
ldr r4, [r0, #0x198]
|
||||
cmp r1, #0
|
||||
beq _0202B5C0
|
||||
ldrb r1, [r0, #0x1a1]
|
||||
add r0, r0, #4
|
||||
cmp r1, #0
|
||||
beq _0202B5AC
|
||||
bl GetTotalNumMenuItems
|
||||
b _0202B5B0
|
||||
_0202B5AC:
|
||||
bl GetSelectedMenuItemIdx
|
||||
_0202B5B0:
|
||||
add r0, r0, r0, lsl #6
|
||||
add r0, r4, r0, lsl #2
|
||||
ldr r0, [r0, #0x100]
|
||||
ldmia sp!, {r4, pc}
|
||||
_0202B5C0:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end GetSimpleMenuResult__0202B870
|
||||
|
||||
arm_func_start UpdateSimpleMenu
|
||||
UpdateSimpleMenu: ; 0x0202B5C8
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
@@ -1,64 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_02050300.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start SetItemAcquired
|
||||
SetItemAcquired: ; 0x02050300
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
ldrsh r0, [r0, #4]
|
||||
bl NormalizeTreasureBox
|
||||
mov r4, r0
|
||||
mov r0, r4, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
bl IsItemValidVeneer
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r4, r5, r6, pc}
|
||||
cmp r4, #0x3b
|
||||
blt _02050380
|
||||
cmp r4, #0x41
|
||||
bgt _02050380
|
||||
sub r0, r4, #0x21
|
||||
and r0, r0, #0xff
|
||||
mov r5, #1
|
||||
bl SetAdventureLogCompleted
|
||||
mov r6, #0x1a
|
||||
b _02050364
|
||||
_0205034C:
|
||||
and r0, r6, #0xff
|
||||
bl GetAdventureLogCompleted
|
||||
cmp r0, #0
|
||||
moveq r5, #0
|
||||
beq _0205036C
|
||||
add r6, r6, #1
|
||||
_02050364:
|
||||
cmp r6, #0x20
|
||||
ble _0205034C
|
||||
_0205036C:
|
||||
cmp r5, #0
|
||||
beq _02050380
|
||||
mov r0, #0x15
|
||||
mov r1, #1
|
||||
bl SetResolvedPerformanceProgressFlag
|
||||
_02050380:
|
||||
ldr r3, _020503C8 ; =ADVENTURE_LOG_PTR
|
||||
mov r0, r4, asr #4
|
||||
ldr ip, [r3]
|
||||
add r0, r4, r0, lsr #27
|
||||
mov r2, r4, lsr #0x1f
|
||||
rsb r1, r2, r4, lsl #27
|
||||
add lr, ip, #0x1b0
|
||||
mov ip, r0, asr #5
|
||||
ldr r4, [lr, ip, lsl #2]
|
||||
add r0, r2, r1, ror #27
|
||||
mov r1, #1
|
||||
orr r0, r4, r1, lsl r0
|
||||
str r0, [lr, ip, lsl #2]
|
||||
ldr r1, [r3]
|
||||
ldr r0, [r1]
|
||||
orr r0, r0, #8
|
||||
str r0, [r1]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_020503C8: .word ADVENTURE_LOG_PTR
|
||||
arm_func_end SetItemAcquired
|
||||
@@ -1,68 +1,8 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "main_02051504.inc"
|
||||
.include "main_020515C4.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start RetrieveFromItemList1
|
||||
RetrieveFromItemList1: ; 0x02051504
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
mov r7, r0
|
||||
ldr r0, _02051564 ; =0x0000270F
|
||||
mov r6, r1
|
||||
bl RandIntSafe
|
||||
mov r4, r0
|
||||
ldr r0, _02051564 ; =0x0000270F
|
||||
bl RandIntSafe
|
||||
mov r5, r0
|
||||
ldrb r0, [r7]
|
||||
cmp r0, #0xb4
|
||||
cmphs r0, #0xd3
|
||||
movhs r0, #0x55
|
||||
ldmhsia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
bl GetNbFloorsPlusOne
|
||||
ldrb r1, [r7, #1]
|
||||
cmp r1, r0
|
||||
movhs r0, #0x55
|
||||
ldmhsia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
mov r0, r6
|
||||
mov r1, r4
|
||||
mov r2, r5
|
||||
bl GetItemIdFromList
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_02051564: .word 0x0000270F
|
||||
arm_func_end RetrieveFromItemList1
|
||||
|
||||
arm_func_start IsForbiddenFloor
|
||||
IsForbiddenFloor: ; 0x02051568
|
||||
stmdb sp!, {r3, lr}
|
||||
mov r1, r0
|
||||
add r0, sp, #0
|
||||
bl DungeonFloorToGroupFloor
|
||||
ldrb ip, [sp]
|
||||
ldrb lr, [sp, #1]
|
||||
ldr r1, _020515C0 ; =MISSION_FLOORS_FORBIDDEN
|
||||
mov r3, #0
|
||||
_02051588:
|
||||
ldrb r0, [r1, r3, lsl #1]
|
||||
mov r2, r3, lsl #1
|
||||
cmp r0, #0x64
|
||||
beq _020515B8
|
||||
cmp ip, r0
|
||||
addeq r0, r1, r2
|
||||
ldreqb r0, [r0, #1]
|
||||
cmpeq lr, r0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, pc}
|
||||
add r3, r3, #1
|
||||
b _02051588
|
||||
_020515B8:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_020515C0: .word MISSION_FLOORS_FORBIDDEN
|
||||
arm_func_end IsForbiddenFloor
|
||||
|
||||
arm_func_start Copy16BitsTo
|
||||
Copy16BitsTo: ; 0x020515C4
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
@@ -1,89 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_02301D84.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start OtherMonsterAbilityIsActive
|
||||
OtherMonsterAbilityIsActive: ; 0x02301D84
|
||||
#ifdef JAPAN
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, lr}
|
||||
mov r5, r0
|
||||
mov r4, r1
|
||||
mov r7, #0
|
||||
ldr r6, _02301E14 ; =DUNGEON_PTR
|
||||
b _02303354
|
||||
_023032F4:
|
||||
ldr r0, [r6]
|
||||
add r0, r0, r7, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
ldr r8, [r0, #0xad4]
|
||||
mov r0, r8
|
||||
bl EntityIsValid__023000E4
|
||||
cmp r0, #0
|
||||
cmpne r5, r8
|
||||
beq _02303348
|
||||
mov r0, r5
|
||||
mov r1, r8
|
||||
bl ShouldTreatMonsterAsAlly
|
||||
cmp r0, #0
|
||||
beq _02303348
|
||||
mov r0, r5
|
||||
mov r1, r8
|
||||
mov r2, r4
|
||||
bl DefenderAbilityIsActive__02301A0C
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
ldmneia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
_02303348:
|
||||
add r0, r7, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
_02303354:
|
||||
cmp r7, #0x14
|
||||
blt _023032F4
|
||||
mov r0, #0
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
#else
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr}
|
||||
mov r7, r0
|
||||
mov r6, r1
|
||||
mov r5, #0
|
||||
mov r4, #1
|
||||
ldr r8, _02301E14 ; =DUNGEON_PTR
|
||||
b _02301E04
|
||||
_02301DA0:
|
||||
ldr r0, [r8]
|
||||
add r0, r0, r5, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
ldr sb, [r0, #0xb78]
|
||||
mov r0, sb
|
||||
bl EntityIsValid__023000E4
|
||||
cmp r0, #0
|
||||
cmpne r7, sb
|
||||
beq _02301DF8
|
||||
mov r0, r7
|
||||
mov r1, sb
|
||||
bl ShouldTreatMonsterAsAlly
|
||||
cmp r0, #0
|
||||
beq _02301DF8
|
||||
mov r0, r7
|
||||
mov r1, sb
|
||||
mov r2, r6
|
||||
mov r3, r4
|
||||
bl DefenderAbilityIsActive__02301A0C
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc}
|
||||
_02301DF8:
|
||||
add r0, r5, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r5, r0, asr #0x10
|
||||
_02301E04:
|
||||
cmp r5, #0x14
|
||||
blt _02301DA0
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc}
|
||||
#endif
|
||||
.align 2, 0
|
||||
_02301E14: .word DUNGEON_PTR
|
||||
arm_func_end OtherMonsterAbilityIsActive
|
||||
@@ -1,374 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0230E064.inc"
|
||||
|
||||
.text
|
||||
|
||||
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 WaitUntilAlertBoxPauseIsOver
|
||||
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 ChangeMonsterAnimationToIdle
|
||||
ldrsh r0, [r4, #2]
|
||||
mov r1, #1
|
||||
bl IsMonsterOnTeam
|
||||
cmp r0, #0
|
||||
beq _0230E0FC
|
||||
bl GetMessageLogPreprocessorArgs
|
||||
mov r1, #1
|
||||
str r1, [sp]
|
||||
mov r1, r5
|
||||
ldr r2, [sb, #0xb4]
|
||||
mov r3, r1
|
||||
bl SetPreprocessorArgsStringToName
|
||||
b _0230E114
|
||||
_0230E0FC:
|
||||
bl GetMessageLogPreprocessorArgs
|
||||
mov r1, r5
|
||||
str r1, [sp]
|
||||
ldr r2, [sb, #0xb4]
|
||||
mov r3, r1
|
||||
bl SetPreprocessorArgsStringToName
|
||||
_0230E114:
|
||||
bl GetMessageLogPreprocessorArgs
|
||||
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 GetMessageLogPreprocessorArgs
|
||||
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 DungeonModeSetupAndShowNameKeyboard
|
||||
cmp r0, #0
|
||||
beq _0230E2BC
|
||||
_0230E2D4:
|
||||
add r1, sp, #0xac + TRY_RECRUIT_OFFSET
|
||||
mov r0, r4
|
||||
bl GetRecoloredTeamMemberName
|
||||
mov r1, r4
|
||||
mov r0, #0
|
||||
bl SetMessageLogPreprocessorArgsString
|
||||
mov r0, #1
|
||||
mov r1, #0
|
||||
bl SetPreprocessorArgsIdVal
|
||||
ldr r0, _0230E568 ; =0x00000C7E
|
||||
bl ov29_0230E658
|
||||
ldrsh r1, [r8, #2]
|
||||
ldrsh r2, [r8, #4]
|
||||
mov r0, sb
|
||||
bl RemoveMonsterFromTile
|
||||
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 GetRecoloredTeamMemberName
|
||||
b _0230E38C
|
||||
_0230E380:
|
||||
ldr r1, [r6, #0xb4]
|
||||
ldrsh r1, [r1, #0xc]
|
||||
bl GetRecoloredNameOfTeamMemberAtIdx
|
||||
_0230E38C:
|
||||
mov r0, #0
|
||||
add r1, sp, #0x58
|
||||
bl SetMessageLogPreprocessorArgsString
|
||||
mov r0, #1
|
||||
mov r1, sl
|
||||
mov r2, #0
|
||||
bl SubstitutePlaceholderStringTags
|
||||
bl GetMessageLogPreprocessorArgs
|
||||
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
|
||||
@@ -1,149 +0,0 @@
|
||||
.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
|
||||
37
asm/overlay_29_0230FB30.s
Normal file
37
asm/overlay_29_0230FB30.s
Normal file
@@ -0,0 +1,37 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0230FB30.inc"
|
||||
|
||||
.text
|
||||
|
||||
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
|
||||
@@ -1,108 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0231B1B8.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start TryActivateBadDreams
|
||||
TryActivateBadDreams: ; 0x0231B1B8
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x50
|
||||
mov sl, r0
|
||||
ldr r0, [sl, #0xb4]
|
||||
mov r6, #0
|
||||
ldrb r0, [r0, #6]
|
||||
ldr r4, _0231B30C ; =DUNGEON_PTR
|
||||
mov r7, #0
|
||||
cmp r0, #0
|
||||
moveq r0, #1
|
||||
movne r0, r6
|
||||
and sb, r0, #0xff
|
||||
add r5, sp, #0
|
||||
_0231B1EC:
|
||||
ldr r0, [r4]
|
||||
add r0, r0, r7, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
#ifdef JAPAN
|
||||
ldr r8, [r0, #0xad4]
|
||||
#else
|
||||
ldr r8, [r0, #0xb78]
|
||||
#endif
|
||||
mov r0, r8
|
||||
bl IsMonster__0231B318
|
||||
cmp r0, #0
|
||||
beq _0231B240
|
||||
ldr r0, [r8, #0xb4]
|
||||
cmp sb, #0
|
||||
ldrb r0, [r0, #6]
|
||||
beq _0231B228
|
||||
cmp r0, #0
|
||||
beq _0231B240
|
||||
b _0231B230
|
||||
_0231B228:
|
||||
cmp r0, #0
|
||||
bne _0231B240
|
||||
_0231B230:
|
||||
add r0, r6, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
str r8, [r5, r6, lsl #2]
|
||||
mov r6, r0, asr #0x10
|
||||
_0231B240:
|
||||
add r0, r7, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
cmp r7, #0x14
|
||||
blt _0231B1EC
|
||||
mov r0, #2
|
||||
mov r1, #0x69
|
||||
bl SetPreprocessorArgsIdVal
|
||||
ldr r0, _0231B310 ; =ov10_022C4530
|
||||
mov r8, #0
|
||||
ldrsh r7, [r0]
|
||||
mov r4, #0x18
|
||||
ldr fp, _0231B314 ; =0x0000026E
|
||||
add r5, sp, #0
|
||||
b _0231B2FC
|
||||
_0231B27C:
|
||||
ldr sb, [r5, r8, lsl #2]
|
||||
cmp sb, #0
|
||||
beq _0231B2F0
|
||||
mov r0, sb
|
||||
bl IsMonster__0231B318
|
||||
cmp r0, #0
|
||||
beq _0231B2F0
|
||||
mov r0, sl
|
||||
mov r1, sb
|
||||
bl IsValidTargetEntity
|
||||
cmp r0, #0
|
||||
cmpne sl, sb
|
||||
beq _0231B2F0
|
||||
mov r0, sb
|
||||
bl IsMonsterSleeping
|
||||
cmp r0, #0
|
||||
beq _0231B2F0
|
||||
mov r0, sb
|
||||
mov r1, r7
|
||||
mov r2, r4
|
||||
mov r3, fp
|
||||
bl ApplyDamageAndEffectsWrapper
|
||||
mov r0, sb
|
||||
bl EntityIsValid__0231B194
|
||||
cmp r0, #0
|
||||
beq _0231B2F0
|
||||
mov r0, sl
|
||||
mov r1, sb
|
||||
bl TryEndPetrifiedOrSleepStatus
|
||||
_0231B2F0:
|
||||
add r0, r8, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r8, r0, asr #0x10
|
||||
_0231B2FC:
|
||||
cmp r8, r6
|
||||
blt _0231B27C
|
||||
add sp, sp, #0x50
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_0231B30C: .word DUNGEON_PTR
|
||||
_0231B310: .word ov10_022C4530
|
||||
_0231B314: .word 0x0000026E
|
||||
arm_func_end TryActivateBadDreams
|
||||
@@ -1,534 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0231EDFC.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start TryHurl
|
||||
TryHurl: ; 0x0231EDFC
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0xf4
|
||||
mov r5, r0
|
||||
mov r4, r1
|
||||
cmp r5, r4
|
||||
beq _0231EE54
|
||||
cmp r5, #0
|
||||
moveq r0, #0
|
||||
beq _0231EE34
|
||||
ldr r0, [r5]
|
||||
cmp r0, #1
|
||||
moveq r0, #1
|
||||
movne r0, #0
|
||||
and r0, r0, #0xff
|
||||
_0231EE34:
|
||||
cmp r0, #0
|
||||
beq _0231EE54
|
||||
mov r0, r5
|
||||
mov r1, #0x53
|
||||
bl AbilityIsActiveVeneer
|
||||
cmp r0, #0
|
||||
movne r0, #0
|
||||
bne _0231EE60
|
||||
_0231EE54:
|
||||
mov r0, r4
|
||||
mov r1, #0xe
|
||||
bl AbilityIsActiveVeneer
|
||||
_0231EE60:
|
||||
cmp r0, #0
|
||||
beq _0231EE8C
|
||||
mov r0, #0
|
||||
mov r1, r4
|
||||
mov r2, r0
|
||||
bl SubstitutePlaceholderStringTags
|
||||
ldr r2, _0231F544 ; =0x00000E45
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl LogMessageByIdWithPopupCheckUserTarget
|
||||
b _0231F53C
|
||||
_0231EE8C:
|
||||
cmp r5, r4
|
||||
bne _0231EEB8
|
||||
mov r0, #0
|
||||
mov r1, r4
|
||||
mov r2, r0
|
||||
bl SubstitutePlaceholderStringTags
|
||||
ldr r2, _0231F548 ; =0x00000E46
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl LogMessageByIdWithPopupCheckUserTarget
|
||||
b _0231F53C
|
||||
_0231EEB8:
|
||||
ldrh r0, [r4, #4]
|
||||
mov sl, #0
|
||||
mov r8, sl
|
||||
strh r0, [sp, #0x40]
|
||||
ldrh r0, [r4, #6]
|
||||
strh r0, [sp, #0x42]
|
||||
b _0231F098
|
||||
_0231EED4:
|
||||
mov sl, #0
|
||||
ldr fp, _0231F54C ; =DIRECTIONS_XY
|
||||
mov r6, sl
|
||||
_0231EEE0:
|
||||
ldr r0, _0231F550 ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
add r0, r0, r6, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
#ifdef JAPAN
|
||||
ldr sb, [r0, #0xad4]
|
||||
#else
|
||||
ldr sb, [r0, #0xb78]
|
||||
#endif
|
||||
mov r0, sb
|
||||
bl EntityIsValid__0231F570
|
||||
cmp r0, #0
|
||||
cmpne r5, sb
|
||||
cmpne r4, sb
|
||||
beq _0231F080
|
||||
mov r0, r5
|
||||
mov r1, sb
|
||||
bl CanSeeTarget
|
||||
cmp r0, #0
|
||||
beq _0231F080
|
||||
cmp r8, #0
|
||||
mov r0, r5
|
||||
mov r2, #0
|
||||
mov r1, sb
|
||||
mov r3, #1
|
||||
bne _0231EF48
|
||||
bl GetTreatmentBetweenMonsters
|
||||
cmp r0, #1
|
||||
bne _0231F080
|
||||
b _0231EF54
|
||||
_0231EF48:
|
||||
bl GetTreatmentBetweenMonsters
|
||||
cmp r0, #0
|
||||
bne _0231F080
|
||||
_0231EF54:
|
||||
cmp r8, #0
|
||||
mov r7, #0
|
||||
bne _0231EFF8
|
||||
b _0231EFBC
|
||||
_0231EF64:
|
||||
mov r0, r7, lsl #2
|
||||
ldrsh r1, [fp, r0]
|
||||
ldrsh r3, [sb, #4]
|
||||
add r0, fp, r7, lsl #2
|
||||
ldrsh r2, [r0, #2]
|
||||
add r0, r3, r1
|
||||
strh r0, [sp, #0x34]
|
||||
ldrsh r3, [sb, #6]
|
||||
mov r0, r4
|
||||
add r1, sp, #0x34
|
||||
add r2, r3, r2
|
||||
strh r2, [sp, #0x36]
|
||||
bl CannotMoveToTile
|
||||
cmp r0, #0
|
||||
bne _0231EFB8
|
||||
ldrsh r0, [sp, #0x34]
|
||||
ldrsh r1, [sp, #0x36]
|
||||
bl GetTile
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x800
|
||||
beq _0231EFC4
|
||||
_0231EFB8:
|
||||
add r7, r7, #1
|
||||
_0231EFBC:
|
||||
cmp r7, #8
|
||||
blt _0231EF64
|
||||
_0231EFC4:
|
||||
cmp r7, #8
|
||||
beq _0231F080
|
||||
cmp sl, #0x28
|
||||
bge _0231F080
|
||||
ldrh r1, [sb, #4]
|
||||
mov r3, sl, lsl #2
|
||||
add r0, sp, #0x54
|
||||
add r2, r0, r3
|
||||
strh r1, [r0, r3]
|
||||
ldrh r0, [sb, #6]
|
||||
add sl, sl, #1
|
||||
strh r0, [r2, #2]
|
||||
b _0231F080
|
||||
_0231EFF8:
|
||||
mov r0, r7, lsl #2
|
||||
ldrsh r1, [fp, r0]
|
||||
ldrsh r3, [sb, #4]
|
||||
add r0, fp, r7, lsl #2
|
||||
ldrsh r2, [r0, #2]
|
||||
add r0, r3, r1
|
||||
strh r0, [sp, #0x30]
|
||||
ldrsh r3, [sb, #6]
|
||||
mov r0, r4
|
||||
add r1, sp, #0x30
|
||||
add r2, r3, r2
|
||||
strh r2, [sp, #0x32]
|
||||
bl CannotMoveToTile
|
||||
cmp r0, #0
|
||||
bne _0231F074
|
||||
ldrsh r0, [sp, #0x30]
|
||||
ldrsh r1, [sp, #0x32]
|
||||
bl GetTile
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x800
|
||||
bne _0231F074
|
||||
cmp sl, #0x28
|
||||
bge _0231F074
|
||||
ldrh r3, [sp, #0x30]
|
||||
ldrh r2, [sp, #0x32]
|
||||
mov r0, sl, lsl #2
|
||||
add r1, sp, #0x54
|
||||
add ip, r1, r0
|
||||
strh r3, [r1, r0]
|
||||
add sl, sl, #1
|
||||
strh r2, [ip, #2]
|
||||
_0231F074:
|
||||
add r7, r7, #1
|
||||
cmp r7, #8
|
||||
blt _0231EFF8
|
||||
_0231F080:
|
||||
add r6, r6, #1
|
||||
cmp r6, #0x14
|
||||
blt _0231EEE0
|
||||
cmp sl, #0
|
||||
bne _0231F0A0
|
||||
add r8, r8, #1
|
||||
_0231F098:
|
||||
cmp r8, #2
|
||||
blt _0231EED4
|
||||
_0231F0A0:
|
||||
cmp sl, #0
|
||||
beq _0231F0D0
|
||||
mov r0, sl
|
||||
bl DungeonRandInt
|
||||
add r1, sp, #0x54
|
||||
mov r2, r0, lsl #2
|
||||
add r0, r1, r0, lsl #2
|
||||
ldrh r1, [r1, r2]
|
||||
ldrh r0, [r0, #2]
|
||||
strh r1, [sp, #0x40]
|
||||
strh r0, [sp, #0x42]
|
||||
b _0231F178
|
||||
_0231F0D0:
|
||||
mov r0, r5
|
||||
bl HasDropeyeStatus
|
||||
mov r2, r0
|
||||
add r1, sp, #0x44
|
||||
add r0, r5, #4
|
||||
bl ov29_022E9298
|
||||
mov r7, #0
|
||||
add r6, sp, #0x2c
|
||||
b _0231F154
|
||||
_0231F0F4:
|
||||
ldr r0, [sp, #0x44]
|
||||
ldr r1, [sp, #0x4c]
|
||||
bl DungeonRandRange
|
||||
strh r0, [sp, #0x2c]
|
||||
ldr r0, [sp, #0x48]
|
||||
ldr r1, [sp, #0x50]
|
||||
bl DungeonRandRange
|
||||
strh r0, [sp, #0x2e]
|
||||
mov r0, r4
|
||||
mov r1, r6
|
||||
bl CannotMoveToTile
|
||||
cmp r0, #0
|
||||
bne _0231F150
|
||||
ldrsh r0, [sp, #0x2c]
|
||||
ldrsh r1, [sp, #0x2e]
|
||||
bl GetTile
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x800
|
||||
ldreqh r1, [sp, #0x2c]
|
||||
ldreqh r0, [sp, #0x2e]
|
||||
streqh r1, [sp, #0x40]
|
||||
streqh r0, [sp, #0x42]
|
||||
beq _0231F15C
|
||||
_0231F150:
|
||||
add r7, r7, #1
|
||||
_0231F154:
|
||||
cmp r7, #0x64
|
||||
blt _0231F0F4
|
||||
_0231F15C:
|
||||
cmp r7, #0x64
|
||||
bne _0231F178
|
||||
ldr r2, _0231F554 ; =0x00000E48
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl LogMessageByIdWithPopupCheckUserTarget
|
||||
b _0231F53C
|
||||
_0231F178:
|
||||
mov r0, #0
|
||||
mov r1, r4
|
||||
mov r2, r0
|
||||
bl SubstitutePlaceholderStringTags
|
||||
ldr r2, _0231F558 ; =0x00000E47
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl LogMessageByIdWithPopupCheckUserTarget
|
||||
mov r0, r4
|
||||
bl ShouldDisplayEntityWrapper
|
||||
cmp r0, #0
|
||||
beq _0231F1B0
|
||||
ldr r0, _0231F55C ; =0x00000212
|
||||
bl PlaySeByIdIfNotSilence
|
||||
_0231F1B0:
|
||||
ldrsh r3, [sp, #0x42]
|
||||
ldrsh r2, [r4, #6]
|
||||
ldrsh r1, [sp, #0x40]
|
||||
ldrsh r0, [r4, #4]
|
||||
sub r2, r3, r2
|
||||
ldr r6, [r4, #0xb4]
|
||||
sub r0, r1, r0
|
||||
cmp r0, r2
|
||||
movle r0, r2
|
||||
mov sb, r0, lsl #4
|
||||
cmp sb, #0x50
|
||||
movgt sb, #0x50
|
||||
cmp sb, #0xa
|
||||
add r0, sp, #0x40
|
||||
add r1, r4, #4
|
||||
ldrb r8, [r6, #0x4c]
|
||||
mov r7, #0
|
||||
movlt sb, #0xa
|
||||
bl GetDirectionTowardsPosition
|
||||
mov r6, r0
|
||||
ldr r0, _0231F54C ; =DIRECTIONS_XY
|
||||
mov r1, r6, lsl #2
|
||||
ldrsh r0, [r0, r1]
|
||||
mov r1, #3
|
||||
mov r0, r0, lsl #8
|
||||
bl _s32_div_f
|
||||
ldrsh sl, [sp, #0x40]
|
||||
mov r1, #0x18
|
||||
ldr r2, _0231F560 ; =DIRECTIONS_XY + 2
|
||||
mov r3, r6, lsl #2
|
||||
smulbb r1, sl, r1
|
||||
add r1, r1, #0xc
|
||||
add r6, r0, r1, lsl #8
|
||||
ldrsh r2, [r2, r3]
|
||||
mov r1, #3
|
||||
mov r0, r2, lsl #8
|
||||
bl _s32_div_f
|
||||
ldrsh r2, [sp, #0x42]
|
||||
mov r1, #0x18
|
||||
ldr sl, [r4, #0xc]
|
||||
smulbb r1, r2, r1
|
||||
add r1, r1, #0x10
|
||||
add fp, r0, r1, lsl #8
|
||||
ldr r0, [r4, #0x10]
|
||||
mov r1, sb
|
||||
sub r0, fp, r0
|
||||
bl _s32_div_f
|
||||
str sl, [sp, #0x38]
|
||||
ldr r1, [r4, #0x10]
|
||||
str r0, [sp, #0x18]
|
||||
sub r0, r6, sl
|
||||
str r1, [sp, #0x3c]
|
||||
mov r1, sb
|
||||
mov sl, #0
|
||||
bl _s32_div_f
|
||||
str r0, [sp, #0x1c]
|
||||
b _0231F31C
|
||||
_0231F294:
|
||||
ldr r2, [sp, #0x38]
|
||||
ldr r0, [sp, #0x1c]
|
||||
ldr r1, [sp, #0x3c]
|
||||
add r0, r2, r0
|
||||
str r0, [sp, #0x38]
|
||||
ldr r0, [sp, #0x18]
|
||||
add r0, r1, r0
|
||||
str r0, [sp, #0x3c]
|
||||
mov r0, r4
|
||||
add r1, sp, #0x38
|
||||
bl UpdateEntityPixelPos
|
||||
mov r0, r4
|
||||
bl ShouldDisplayEntityWrapper
|
||||
cmp r0, #0
|
||||
beq _0231F308
|
||||
mov r0, r7
|
||||
bl SinAbs4096
|
||||
mov r0, r0, lsl #5
|
||||
str r0, [r4, #0x1c]
|
||||
mov r0, #0x3b
|
||||
bl AdvanceFrame
|
||||
tst sl, #3
|
||||
bne _0231F308
|
||||
and r8, r8, #7
|
||||
mov r0, r4
|
||||
mov r1, #6
|
||||
mov r2, r8
|
||||
bl ChangeMonsterAnimation
|
||||
add r8, r8, #1
|
||||
_0231F308:
|
||||
mov r0, #0x800
|
||||
mov r1, sb
|
||||
bl _s32_div_f
|
||||
add r7, r7, r0
|
||||
add sl, sl, #1
|
||||
_0231F31C:
|
||||
cmp sl, sb
|
||||
blt _0231F294
|
||||
add r1, sp, #0x38
|
||||
mov r0, r4
|
||||
str r6, [sp, #0x38]
|
||||
str fp, [sp, #0x3c]
|
||||
mov r2, #0
|
||||
str r2, [r4, #0x1c]
|
||||
bl UpdateEntityPixelPos
|
||||
mov r0, #0x3b
|
||||
bl AdvanceFrame
|
||||
ldr r0, [r4, #0xb4]
|
||||
and r1, r8, #7
|
||||
strb r1, [r0, #0x4c]
|
||||
ldrsh r0, [sp, #0x40]
|
||||
ldrsh r1, [sp, #0x42]
|
||||
bl GetTile
|
||||
ldr r7, [r0, #0xc]
|
||||
mov r0, r7
|
||||
bl EntityIsValid__0231F570
|
||||
cmp r0, #0
|
||||
bne _0231F394
|
||||
ldrsh r1, [sp, #0x40]
|
||||
ldrsh r2, [sp, #0x42]
|
||||
mov r0, r4
|
||||
mov r3, #1
|
||||
bl MoveMonsterToPos
|
||||
mov r0, r4
|
||||
bl ov29_02321238
|
||||
b _0231F53C
|
||||
_0231F394:
|
||||
mov r8, #0
|
||||
ldr r6, _0231F54C ; =DIRECTIONS_XY
|
||||
add sb, sp, #0x28
|
||||
b _0231F40C
|
||||
_0231F3A4:
|
||||
mov r1, r8, lsl #2
|
||||
add r0, r6, r8, lsl #2
|
||||
ldrsh sl, [sp, #0x40]
|
||||
ldrsh r3, [r6, r1]
|
||||
ldrsh r2, [sp, #0x42]
|
||||
ldrsh r1, [r0, #2]
|
||||
add r3, sl, r3
|
||||
mov r0, r4
|
||||
add r2, r2, r1
|
||||
mov r1, sb
|
||||
strh r3, [sp, #0x28]
|
||||
strh r2, [sp, #0x2a]
|
||||
bl CannotMoveToTile
|
||||
cmp r0, #0
|
||||
bne _0231F408
|
||||
ldrsh r0, [sp, #0x28]
|
||||
ldrsh r1, [sp, #0x2a]
|
||||
bl GetTile
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x800
|
||||
ldreqh r1, [sp, #0x28]
|
||||
ldreqh r0, [sp, #0x2a]
|
||||
streqh r1, [sp, #0x40]
|
||||
streqh r0, [sp, #0x42]
|
||||
beq _0231F414
|
||||
_0231F408:
|
||||
add r8, r8, #1
|
||||
_0231F40C:
|
||||
cmp r8, #8
|
||||
blt _0231F3A4
|
||||
_0231F414:
|
||||
cmp r8, #8
|
||||
bne _0231F434
|
||||
mov r2, #0
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
mov r3, r2
|
||||
bl TryWarp
|
||||
b _0231F454
|
||||
_0231F434:
|
||||
add r1, sp, #0x40
|
||||
mov r0, r4
|
||||
bl ov29_0232033C
|
||||
ldrsh r1, [sp, #0x40]
|
||||
ldrsh r2, [sp, #0x42]
|
||||
mov r0, r4
|
||||
mov r3, #1
|
||||
bl MoveMonsterToPos
|
||||
_0231F454:
|
||||
ldr r0, [r7]
|
||||
cmp r0, #1
|
||||
bne _0231F4D4
|
||||
ldr r1, _0231F564 ; =0x00000163
|
||||
add r0, sp, #0x20
|
||||
bl InitMove
|
||||
add r1, sp, #0x20
|
||||
mov r0, r7
|
||||
bl TwoTurnMoveForcedMiss
|
||||
cmp r0, #0
|
||||
bne _0231F4B4
|
||||
mov r3, #0
|
||||
str r3, [sp]
|
||||
ldr r0, _0231F568 ; =HURL_DAMAGE
|
||||
ldr r1, _0231F56C ; =0x00000259
|
||||
str r3, [sp, #4]
|
||||
str r1, [sp, #8]
|
||||
str r3, [sp, #0xc]
|
||||
str r3, [sp, #0x10]
|
||||
ldrsh r2, [r0]
|
||||
mov r0, r5
|
||||
mov r1, r7
|
||||
str r3, [sp, #0x14]
|
||||
bl CalcDamageFixedNoCategory
|
||||
_0231F4B4:
|
||||
mov r0, r7
|
||||
bl EntityIsValid__0231F570
|
||||
cmp r0, #0
|
||||
beq _0231F4D4
|
||||
ldr r1, [r7, #0xb4]
|
||||
mov r0, r7
|
||||
ldrb r1, [r1, #0x4c]
|
||||
bl ChangeMonsterAnimationToIdle
|
||||
_0231F4D4:
|
||||
mov r3, #0
|
||||
str r3, [sp]
|
||||
ldr r0, _0231F568 ; =HURL_DAMAGE
|
||||
str r3, [sp, #4]
|
||||
mov r1, #0x258
|
||||
str r1, [sp, #8]
|
||||
str r3, [sp, #0xc]
|
||||
str r3, [sp, #0x10]
|
||||
ldrsh r2, [r0]
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
str r3, [sp, #0x14]
|
||||
bl CalcDamageFixedNoCategory
|
||||
mov r0, r4
|
||||
bl EntityIsValid__0231F570
|
||||
cmp r0, #0
|
||||
beq _0231F528
|
||||
ldr r1, [r4, #0xb4]
|
||||
mov r0, r4
|
||||
ldrb r1, [r1, #0x4c]
|
||||
bl ChangeMonsterAnimationToIdle
|
||||
_0231F528:
|
||||
mov r0, #0x1e
|
||||
mov r1, #0x3b
|
||||
bl ov29_022EA370
|
||||
mov r0, r4
|
||||
bl ov29_02321238
|
||||
_0231F53C:
|
||||
add sp, sp, #0xf4
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
#ifdef JAPAN
|
||||
#define OV29_0231EDFC_OFFSET -0x2BF
|
||||
#else
|
||||
#define OV29_0231EDFC_OFFSET 0
|
||||
#endif
|
||||
_0231F544: .word 0x00000E45 + OV29_0231EDFC_OFFSET
|
||||
_0231F548: .word 0x00000E46 + OV29_0231EDFC_OFFSET
|
||||
_0231F54C: .word DIRECTIONS_XY
|
||||
_0231F550: .word DUNGEON_PTR
|
||||
_0231F554: .word 0x00000E48 + OV29_0231EDFC_OFFSET
|
||||
_0231F558: .word 0x00000E47 + OV29_0231EDFC_OFFSET
|
||||
_0231F55C: .word 0x00000212
|
||||
_0231F560: .word DIRECTIONS_XY + 2
|
||||
_0231F564: .word 0x00000163
|
||||
_0231F568: .word HURL_DAMAGE
|
||||
_0231F56C: .word 0x00000259
|
||||
arm_func_end TryHurl
|
||||
@@ -1,171 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0234B130.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ov29_0234B130
|
||||
ov29_0234B130: ; 0x0234B130
|
||||
stmdb sp!, {r3, lr}
|
||||
mov r3, #0
|
||||
ldr r1, _0234B1A0 ; =MESSAGE_LOG_INFO
|
||||
mov r0, r3
|
||||
_0234B140:
|
||||
ldr r2, [r1, #4]
|
||||
add r2, r2, r3
|
||||
add r3, r3, #1
|
||||
strb r0, [r2, #0xc80]
|
||||
cmp r3, #0xa
|
||||
blt _0234B140
|
||||
ldr r1, _0234B1A0 ; =MESSAGE_LOG_INFO
|
||||
mvn ip, #1
|
||||
ldr r3, [r1, #4]
|
||||
mov r2, #1
|
||||
strb ip, [r3, #0xcec]
|
||||
ldr r3, [r1, #4]
|
||||
strb r0, [r3, #0xcee]
|
||||
ldr r3, [r1, #4]
|
||||
strb r0, [r3, #0xced]
|
||||
str r0, [r1, #8]
|
||||
strb r2, [r1]
|
||||
bl ov29_0234B1A4
|
||||
ldr r0, _0234B1A0 ; =MESSAGE_LOG_INFO
|
||||
ldr r0, [r0, #4]
|
||||
add r0, r0, #0x9c
|
||||
add r0, r0, #0xc00
|
||||
bl InitPreprocessorArgs
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_0234B1A0: .word MESSAGE_LOG_INFO
|
||||
arm_func_end ov29_0234B130
|
||||
|
||||
arm_func_start ov29_0234B1A4
|
||||
ov29_0234B1A4: ; 0x0234B1A4
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
bl ov29_022E9FC0
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r4, pc}
|
||||
mov ip, #0
|
||||
ldr r2, _0234B24C ; =MESSAGE_LOG_INFO
|
||||
mov r0, ip
|
||||
_0234B1C4:
|
||||
ldr r3, [r2, #4]
|
||||
add r1, ip, ip, lsl #2
|
||||
add ip, ip, #1
|
||||
strb r0, [r3, r1, lsl #6]
|
||||
cmp ip, #0xa
|
||||
blt _0234B1C4
|
||||
ldr r2, _0234B24C ; =MESSAGE_LOG_INFO
|
||||
mov r3, #4
|
||||
ldr r1, [r2, #4]
|
||||
strb r0, [r1, #0xc8b]
|
||||
ldr r1, [r2, #4]
|
||||
add r1, r1, #0xc00
|
||||
strh r0, [r1, #0x8c]
|
||||
ldr r1, [r2, #4]
|
||||
add r1, r1, #0xc00
|
||||
strh r0, [r1, #0x8e]
|
||||
ldr r1, [r2, #4]
|
||||
add r1, r1, #0xc00
|
||||
strh r0, [r1, #0x90]
|
||||
ldr r1, [r2, #4]
|
||||
add r1, r1, #0xc00
|
||||
strh r3, [r1, #0x92]
|
||||
ldr r1, [r2, #4]
|
||||
str r0, [r1, #0xc98]
|
||||
bl FullyCloseAlertBox
|
||||
cmp r0, #0
|
||||
cmpne r4, #0
|
||||
ldmeqia sp!, {r4, pc}
|
||||
mov r0, #0
|
||||
mov r1, r0
|
||||
bl UnkMapRelatedFunc
|
||||
mov r0, #0xb
|
||||
bl AdvanceFrame
|
||||
ldmia sp!, {r4, pc}
|
||||
.align 2, 0
|
||||
_0234B24C: .word MESSAGE_LOG_INFO
|
||||
arm_func_end ov29_0234B1A4
|
||||
|
||||
arm_func_start LogMessageByIdWithPopupCheckParticipants
|
||||
LogMessageByIdWithPopupCheckParticipants: ; 0x0234B250
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr ip, _0234B290 ; =MESSAGE_LOG_INFO
|
||||
cmp r1, #0
|
||||
ldr ip, [ip, #4]
|
||||
ldrsh lr, [sp, #8]
|
||||
add r3, ip, r3, lsl #2
|
||||
cmpne r0, #0
|
||||
str lr, [r3, #0xcac]
|
||||
beq _0234B27C
|
||||
bl LogMessageByIdWithPopupCheckUserTarget
|
||||
ldmia sp!, {r3, pc}
|
||||
_0234B27C:
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r3, pc}
|
||||
mov r1, r2
|
||||
bl LogMessageByIdWithPopupCheckUser
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_0234B290: .word MESSAGE_LOG_INFO
|
||||
arm_func_end LogMessageByIdWithPopupCheckParticipants
|
||||
|
||||
arm_func_start WaitUntilAlertBoxTextIsLoadedWrapper
|
||||
WaitUntilAlertBoxTextIsLoadedWrapper: ; 0x0234B294
|
||||
ldr ip, _0234B2A0 ; =WaitUntilAlertBoxTextIsLoaded
|
||||
mov r0, #0x50
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_0234B2A0: .word WaitUntilAlertBoxTextIsLoaded
|
||||
arm_func_end WaitUntilAlertBoxTextIsLoadedWrapper
|
||||
|
||||
arm_func_start LogMessageByIdWithPopupCheckUser
|
||||
LogMessageByIdWithPopupCheckUser: ; 0x0234B2A4
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r4, #0
|
||||
mov r6, r0
|
||||
mov r5, r1
|
||||
bl ShouldDisplayEntityWrapper
|
||||
cmp r0, #0
|
||||
movne r4, #1
|
||||
cmp r4, #0
|
||||
ldmeqia sp!, {r4, r5, r6, pc}
|
||||
mov r0, r5
|
||||
bl StringFromId
|
||||
mov r1, r0
|
||||
mov r0, r6
|
||||
mov r2, #1
|
||||
bl LogMessage
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
arm_func_end LogMessageByIdWithPopupCheckUser
|
||||
|
||||
arm_func_start LogMessageWithPopupCheckUser
|
||||
LogMessageWithPopupCheckUser: ; 0x0234B2E4
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r4, #0
|
||||
mov r6, r0
|
||||
mov r5, r1
|
||||
bl ShouldDisplayEntityWrapper
|
||||
cmp r0, #0
|
||||
movne r4, #1
|
||||
cmp r4, #0
|
||||
ldmeqia sp!, {r4, r5, r6, pc}
|
||||
mov r0, r6
|
||||
mov r1, r5
|
||||
mov r2, #1
|
||||
bl LogMessage
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
arm_func_end LogMessageWithPopupCheckUser
|
||||
|
||||
arm_func_start LogMessageByIdQuiet
|
||||
LogMessageByIdQuiet: ; 0x0234B31C
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
mov r0, r1
|
||||
bl StringFromId
|
||||
mov r1, r0
|
||||
mov r0, r4
|
||||
mov r2, #0
|
||||
bl LogMessage
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end LogMessageByIdQuiet
|
||||
@@ -54,9 +54,7 @@ struct ground_monster {
|
||||
// Stores information about active team members, including those from special episodes.
|
||||
// A lot of the fields seem to be analogous to fields on struct monster.
|
||||
struct team_member {
|
||||
// 0x0: flags: 1-byte bitfield
|
||||
u8 f_is_valid : 1;
|
||||
u8 flags_unk1 : 7;
|
||||
u8 flags;
|
||||
|
||||
u8 is_leader; // 0x1
|
||||
u8 level; // 0x2
|
||||
|
||||
@@ -10,5 +10,6 @@ bool8 AbilityIsActive(struct entity *entity, enum ability_id ability_id);
|
||||
// Likely a linker-generated veneer for AbilityIsActive.
|
||||
// See https://developer.arm.com/documentation/dui0474/k/image-structure-and-generation/linker-generated-veneers/what-is-a-veneer-
|
||||
bool8 AbilityIsActiveVeneer(struct entity *entity, enum ability_id ability_id);
|
||||
bool8 OtherMonsterAbilityIsActive(struct entity *entity, enum ability_id ability_id);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_POKEMON_ATTRIBUTES_H
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
bool8 RecruitCheck(struct entity* leader, struct entity* target);
|
||||
bool8 SpecificRecruitCheck(u32 monster_id);
|
||||
extern bool8 DebugRecruitingEnabled(u32 monster_id);
|
||||
bool8 TryRecruit(struct entity *user, struct entity *recruit, void *recruit_info);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_RECRUITMENT_H
|
||||
|
||||
@@ -12,5 +12,8 @@ u16 Rand16Bit();
|
||||
u32 RandInt(u32 n);
|
||||
s32 RandRange(s32 x, s32 y);
|
||||
u32 Rand32Bit();
|
||||
void sub_020022C4(u32 *param_1);
|
||||
u32 sub_020022D0(u32 *param_1, u32 param_2);
|
||||
s32 RandIntSafe(s32 n);
|
||||
|
||||
#endif //PMDSKY_MAIN_0200224C_H
|
||||
|
||||
@@ -6,5 +6,7 @@ void StrcpySimple(unsigned char* dest, const unsigned char* src);
|
||||
void StrncpySimple(unsigned char* dest, const unsigned char* src, s32 n);
|
||||
void StrncpySimpleNoPad(unsigned char* dest, const unsigned char* src, s32 n);
|
||||
int StrncmpSimple(const unsigned char* c1, const unsigned char* c2, s32 n);
|
||||
u16 sub_020251F0(u8 c);
|
||||
void StrncpySimpleNoPadSafe(unsigned char* dest, const unsigned char* src, s32 n);
|
||||
|
||||
#endif //PMDSKY_MAIN_020251AC_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
struct unk_02026130 {
|
||||
u8 field_0x0[4];
|
||||
u8 field_0x4[4];
|
||||
u8 field_0x4[0x118];
|
||||
};
|
||||
|
||||
void sub_0202613C(struct unk_02026130* p);
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
|
||||
void sub_02026174(struct unk_02026130* p);
|
||||
void sub_02026184(struct unk_02026130* p);
|
||||
void sub_02026194(struct unk_02026130* p);
|
||||
void sub_02026194(struct unk_02026130* p, u32 flags, char* string);
|
||||
void sub_020261A4(struct unk_02026130* p);
|
||||
void sub_020261B4(struct unk_02026130* p);
|
||||
void sub_020261C4(struct unk_02026130* p);
|
||||
void sub_020261D4(struct unk_02026130* p);
|
||||
void sub_020261E4(struct unk_02026130* p);
|
||||
void sub_020261F4(struct unk_02026130* p, void* dst);
|
||||
void sub_02026204(struct unk_02026130* p);
|
||||
void DrawTextInWindow(s32 window_id, s32 x, s32 y, char* string);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
#define PMDSKY_MAIN_0202B558_H
|
||||
|
||||
s32 GetSimpleMenuField0x1A4(s32 window_id);
|
||||
s32 sub_0202B568(s32 window_id);
|
||||
s32 GetSimpleMenuResult__0202B870(s32 window_id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
#include "adventure_log.h"
|
||||
void IncrementNbFainted(void);
|
||||
u32 GetNbFainted(void);
|
||||
void SetItemAcquired(struct item *item);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#ifndef PMDSKY_MAIN_020514CC_H
|
||||
#define PMDSKY_MAIN_020514CC_H
|
||||
#include "util.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
bool32 IsDojoDungeon(u8 dungeon_id);
|
||||
bool32 IsFutureDungeon(u8 dungeon_id);
|
||||
bool32 IsSpecialEpisodeDungeon(u8 dungeon_id);
|
||||
s32 RetrieveFromItemList1(struct dungeon_floor_pair *pair, s32 list_idx);
|
||||
bool8 IsForbiddenFloor(struct dungeon_floor_pair *pair);
|
||||
|
||||
#endif //PMDSKY_MAIN_020514CC_H
|
||||
|
||||
@@ -8,5 +8,7 @@ bool8 ExclusiveItemEffectIsActive__0230F8AC(struct entity *entity, enum exclusiv
|
||||
u8 FindDirectionOfAdjacentMonsterWithItem(struct entity *entity, enum item_id item_id);
|
||||
// Checks if an entity is a monster (entity type 1).
|
||||
bool8 IsMonster__0230F980(struct entity *entity);
|
||||
void ov29_0230F9A4(struct entity *entity, struct item *item);
|
||||
void TrySpawnEnemyItemDrop(struct entity *attacker, struct entity *defender);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0230F8AC_H
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
|
||||
// Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity).
|
||||
bool8 EntityIsValid__0231B194(struct entity *entity);
|
||||
void TryActivateBadDreams(struct entity *attacker);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0231B194_H
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
|
||||
// Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity).
|
||||
bool8 EntityIsValid__0231EDD8(struct entity *entity);
|
||||
void TryHurl(struct entity *user, struct entity *target);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0231EDD8_H
|
||||
|
||||
@@ -18,7 +18,7 @@ struct alert_box_info {
|
||||
// (i.e. for which the scrolling is finished)
|
||||
u16 alert_box_current_loaded_idx;
|
||||
s16 frames_until_close; // 0xC90
|
||||
u8 field_0xc92;
|
||||
u16 field_0xc92;
|
||||
u8 field_0xc94;
|
||||
u8 field_0xc95;
|
||||
u8 field_0xc96;
|
||||
@@ -27,7 +27,7 @@ struct alert_box_info {
|
||||
// 2 means a message is currently loading/scrolling.
|
||||
u32 loading_status;
|
||||
struct preprocessor_args preprocessor_args;
|
||||
u8 alert_box_window_id; // 0xCEC
|
||||
s8 alert_box_window_id;
|
||||
u8 field_0xced;
|
||||
u8 field_0xcee;
|
||||
u8 field_0xcef;
|
||||
|
||||
@@ -3,8 +3,16 @@
|
||||
|
||||
#include "util.h"
|
||||
#include "main_0200C4FC.h"
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
void SetMessageLogPreprocessorArgsSpeakerId(u32 monster_id);
|
||||
void SetMessageLogPreprocessorArgsSpeakerId0x30000(u32 team_index);
|
||||
void ov29_0234B130(void);
|
||||
void ov29_0234B1A4(bool8 param_1);
|
||||
void LogMessageByIdWithPopupCheckParticipants(struct entity *user, struct entity *target, u32 message_id, s32 pos, s16 val);
|
||||
void WaitUntilAlertBoxTextIsLoadedWrapper(void);
|
||||
void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
void LogMessageWithPopupCheckUser(struct entity *user, const char *message);
|
||||
void LogMessageByIdQuiet(struct entity *user, u32 message_id);
|
||||
|
||||
#endif
|
||||
|
||||
18
main.lsf
18
main.lsf
@@ -22,7 +22,7 @@ Static main
|
||||
Object src/main_02001CD4.o
|
||||
Object asm/main_02001D68.o
|
||||
Object src/main_0200224C.o
|
||||
Object asm/main_020022C4.o
|
||||
Object asm/main_02002318.o
|
||||
Object src/main_0200238C.o
|
||||
Object asm/main_020024E4.o
|
||||
Object src/main_020027E8.o
|
||||
@@ -132,13 +132,13 @@ Static main
|
||||
Object src/main_0201E380.o
|
||||
Object asm/main_0201E3AC.o
|
||||
Object src/main_020251AC.o
|
||||
Object asm/main_020251F0.o
|
||||
Object asm/main_02025230.o
|
||||
Object src/main_02025788.o
|
||||
Object src/main_0202593C.o
|
||||
Object asm/main_0202598C.o
|
||||
Object src/main_0202613C.o
|
||||
Object src/main_02026174.o
|
||||
Object asm/main_020261F4.o
|
||||
Object asm/main_02026268.o
|
||||
Object src/main_020265C4.o
|
||||
Object asm/main_0202676C.o
|
||||
Object src/main_020275F8.o
|
||||
@@ -167,7 +167,7 @@ Static main
|
||||
Object asm/main_0202AB94.o
|
||||
Object src/main_0202B4C4.o
|
||||
Object src/main_0202B558.o
|
||||
Object asm/main_0202B568.o
|
||||
Object asm/main_0202B5C8.o
|
||||
Object src/main_0202BA0C.o
|
||||
Object asm/main_0202BA20.o
|
||||
Object src/main_0202BC44.o
|
||||
@@ -263,7 +263,6 @@ Static main
|
||||
Object src/main_0204FEB4.o
|
||||
Object asm/main_0204FFEC.o
|
||||
Object src/main_020502B0.o
|
||||
Object asm/main_02050300.o
|
||||
Object src/main_020503CC.o
|
||||
Object asm/main_02050420.o
|
||||
Object src/main_020504A4.o
|
||||
@@ -272,7 +271,7 @@ Static main
|
||||
Object asm/main_02051098.o
|
||||
Object src/dungeon_recruitment_2.o
|
||||
Object src/main_020514CC.o
|
||||
Object asm/main_02051504.o
|
||||
Object asm/main_020515C4.o
|
||||
Object src/main_02051760.o
|
||||
Object src/tactics_data.o
|
||||
Object asm/main_rodata_020A190C.o
|
||||
@@ -952,7 +951,6 @@ Overlay OVY_29
|
||||
Object src/overlay_29_02301A60.o
|
||||
Object asm/overlay_29_02301A84.o
|
||||
Object src/dungeon_pokemon_attributes.o
|
||||
Object asm/overlay_29_02301D84.o
|
||||
Object src/dungeon_logic_3.o
|
||||
Object src/dungeon_pokemon_attributes_1.o
|
||||
Object src/dungeon_logic_5.o
|
||||
@@ -989,7 +987,6 @@ Overlay OVY_29
|
||||
Object src/overlay_29_0230BBAC.o
|
||||
Object asm/overlay_29_0230D088.o
|
||||
Object src/dungeon_recruitment.o
|
||||
Object asm/overlay_29_0230E064.o
|
||||
Object src/overlay_29_0230E578.o
|
||||
Object asm/overlay_29_0230E5A8.o
|
||||
Object src/dungeon_ai_items.o
|
||||
@@ -998,7 +995,7 @@ Overlay OVY_29
|
||||
Object asm/overlay_29_0230F02C.o
|
||||
Object src/overlay_29_0230F810.o
|
||||
Object src/overlay_29_0230F8AC.o
|
||||
Object asm/overlay_29_0230F9A4.o
|
||||
Object asm/overlay_29_0230FB30.o
|
||||
Object src/overlay_29_02311010.o
|
||||
Object asm/overlay_29_02311088.o
|
||||
Object src/overlay_29_023118B4.o
|
||||
@@ -1031,7 +1028,6 @@ Overlay OVY_29
|
||||
Object src/special_move_types.o
|
||||
Object asm/overlay_29_0231AFB4.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
|
||||
@@ -1040,7 +1036,6 @@ Overlay OVY_29
|
||||
Object src/overlay_29_0231E9F0.o
|
||||
Object asm/overlay_29_0231EA40.o
|
||||
Object src/overlay_29_0231EDD8.o
|
||||
Object asm/overlay_29_0231EDFC.o
|
||||
Object src/overlay_29_0231F570.o
|
||||
Object asm/overlay_29_0231F594.o
|
||||
Object src/overlay_29_0231FBFC.o
|
||||
@@ -1279,7 +1274,6 @@ Overlay OVY_29
|
||||
Object src/overlay_29_0234AFFC.o
|
||||
Object src/overlay_29_0234B024.o
|
||||
Object src/overlay_29_0234B104.o
|
||||
Object asm/overlay_29_0234B130.o
|
||||
Object src/overlay_29_0234B340.o
|
||||
Object asm/overlay_29_0234B3A4.o
|
||||
Object src/overlay_29_0234B4BC.o
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "status_checks.h"
|
||||
#include "targeting.h"
|
||||
#include "dungeon_util_2.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
#ifdef JAPAN
|
||||
#define CANNOT_USE_ITEM_MESSAGE 0xB2D
|
||||
@@ -28,7 +29,6 @@
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
|
||||
extern void EndFrozenClassStatus(struct entity *user, struct entity *target, bool8 log);
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
|
||||
void RunMonsterAi(struct entity *monster, u32 unused)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
|
||||
#include "overlay_29_0234BA54.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
extern void ov29_0234D8A0(s32 a);
|
||||
extern s16 ov29_022DE5F0(s32 index);
|
||||
extern void ov29_022EA370(s32 a, s32 b);
|
||||
extern int ov29_0234B1A4();
|
||||
extern void ov29_0234D630(void);
|
||||
extern s8 ov29_023535A4;
|
||||
extern s16 ov29_0237C9A0[2];
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "overlay_29_02301A60.h"
|
||||
#include "overlay_29_023000E4.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
extern bool8 ShouldTreatMonsterAsAlly(struct entity *monster, struct entity *other);
|
||||
|
||||
bool8 NoGastroAcidStatus(struct entity *entity, enum ability_id ability_id)
|
||||
{
|
||||
@@ -35,3 +39,21 @@ bool8 AbilityIsActiveVeneer(struct entity *entity, enum ability_id ability_id)
|
||||
{
|
||||
return AbilityIsActive(entity, ability_id);
|
||||
}
|
||||
|
||||
bool8 OtherMonsterAbilityIsActive(struct entity *entity, enum ability_id ability_id)
|
||||
{
|
||||
for (s16 i = 0; i < DUNGEON_MAX_POKEMON; i++)
|
||||
{
|
||||
struct entity *target = DUNGEON_PTR[0]->active_monster_ptrs[i];
|
||||
if (EntityIsValid__023000E4(target) && entity != target &&
|
||||
ShouldTreatMonsterAsAlly(entity, target) &&
|
||||
#ifdef JAPAN
|
||||
DefenderAbilityIsActive__02301A0C(entity, target, ability_id))
|
||||
#else
|
||||
DefenderAbilityIsActive__02301A0C(entity, target, ability_id, TRUE))
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,67 @@
|
||||
#include "overlay_29_0230E578.h" // ItemIsActive__0230E578
|
||||
#include "progression.h"
|
||||
#include "overlay_29_02349208.h"
|
||||
#include "common.h"
|
||||
#include "dungeon_util_2.h"
|
||||
#include "main_020251AC.h"
|
||||
#include "main_0204FDFC.h"
|
||||
#include "main_02058E68.h"
|
||||
#include "overlay_29_022E68BC.h"
|
||||
#include "overlay_29_022EAC7C.h"
|
||||
#include "overlay_29_0234B024.h"
|
||||
#include "overlay_29_0234BA54.h"
|
||||
#include "position_util.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
struct unk_0230E064 {
|
||||
s16 field_0x0;
|
||||
s16 field_0x2;
|
||||
s16 field_0x4;
|
||||
s16 field_0x6;
|
||||
u8 field_0x8[2];
|
||||
u8 field_0xa[2];
|
||||
s16 field_0xc;
|
||||
s16 field_0xe;
|
||||
s32 field_0x10;
|
||||
u16 field_0x14;
|
||||
u16 field_0x16;
|
||||
u16 field_0x18;
|
||||
u16 field_0x1a;
|
||||
struct item field_0x1c;
|
||||
struct moves field_0x22;
|
||||
u16 field_0x44;
|
||||
u16 field_0x46;
|
||||
};
|
||||
|
||||
void SetPreprocessorArgsStringToName(struct preprocessor_args *preprocessor_args,
|
||||
s32 pos, struct monster *monster,
|
||||
u32 param_4, u8 name_type);
|
||||
void HandleFaint(struct entity *fainted_entity, s32 damage_source,
|
||||
struct entity *killer);
|
||||
struct team_member *GetActiveTeamMember(s32 roster_idx);
|
||||
void GetRecoloredTeamMemberName(char *dst, struct team_member *team_member);
|
||||
void ov29_0234D630(void);
|
||||
void ov29_0234D838(void);
|
||||
const u8 *GetNameString(enum monster_id monster_id);
|
||||
void StrncpyName(char *dest, const char *src, u32 n);
|
||||
void EnsureCanStandCurrentTile(struct entity *entity);
|
||||
void ov29_02305F60(struct entity *user, struct entity *target);
|
||||
void ChangeMonsterAnimationToIdle(struct entity *monster, s32 direction);
|
||||
s32 ov29_0234D7C0(s32 message_id, struct preprocessor_args *args, s32 param_3,
|
||||
s32 param_4, u8 param_5);
|
||||
void ov29_0234D8A0(s32 param_1);
|
||||
struct entity *ov29_0234EE10(struct entity *entity, char *name);
|
||||
bool8 DungeonModeSetupAndShowNameKeyboard(char *name, char *param_2, s32 param_3);
|
||||
void RemoveMonsterFromTile(struct entity *entity, s32 x, s32 y);
|
||||
bool8 ov29_0230E5A8(struct entity *user, struct entity *target, s32 x, s32 y);
|
||||
s32 ov29_0230E5FC(struct team_member *member, s32 param_2);
|
||||
void ov29_0230E658(s32 message_id);
|
||||
void GetRecoloredNameOfTeamMemberAtIdx(char *dst, s32 roster_idx);
|
||||
void sub_02056698(s32 roster_idx, s16 member_idx);
|
||||
void ov29_022E8104(void);
|
||||
bool8 InitTeamMember(s16 monster_id, s32 x, s32 y, struct team_member *member,
|
||||
struct entity **out, bool8 param_6, bool8 param_7,
|
||||
bool8 param_8, bool8 param_9);
|
||||
|
||||
extern bool8 IsLegendaryChallengeFloor(void);
|
||||
extern bool8 IsMonsterOnTeam(s16 monsterId, s32 checkType);
|
||||
@@ -202,3 +263,162 @@ bool8 RecruitCheck(struct entity* leader, struct entity* target)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef JAPAN
|
||||
#define TRY_RECRUIT_MESSAGE_OFFSET -0x2C0
|
||||
#else
|
||||
#define TRY_RECRUIT_MESSAGE_OFFSET 0
|
||||
#endif
|
||||
|
||||
bool8 TryRecruit(struct entity *user, struct entity *recruit, void *recruit_info)
|
||||
{
|
||||
struct unk_0230E064 *info = recruit_info;
|
||||
struct entity *spawned;
|
||||
struct entity *out;
|
||||
#ifdef JAPAN
|
||||
char keyboard_buf[16];
|
||||
#else
|
||||
char keyboard_buf[20];
|
||||
#endif
|
||||
char name_buf2[64];
|
||||
char name_buf1[64];
|
||||
struct team_member member;
|
||||
struct monster *mon;
|
||||
struct entity *ent;
|
||||
char *recolored;
|
||||
struct team_member *slot;
|
||||
s32 dir;
|
||||
s32 response;
|
||||
s32 idx;
|
||||
bool8 ret;
|
||||
s16 i;
|
||||
|
||||
spawned = NULL;
|
||||
WaitUntilAlertBoxPauseIsOver(10);
|
||||
ov29_0234B1A4(0);
|
||||
ov29_0234D630();
|
||||
idx = -1;
|
||||
dir = GetDirectionTowardsPosition(&recruit->pos, &user->pos);
|
||||
mon = recruit->info;
|
||||
recruit->transparent = 0;
|
||||
ov29_02305F60(user, recruit);
|
||||
ChangeMonsterAnimationToIdle(recruit, dir);
|
||||
if (IsMonsterOnTeam(mon->id, 1)) {
|
||||
SetPreprocessorArgsStringToName(GetMessageLogPreprocessorArgs(), 0,
|
||||
recruit->info, 0, 1);
|
||||
} else {
|
||||
SetPreprocessorArgsStringToName(GetMessageLogPreprocessorArgs(), 0,
|
||||
recruit->info, 0, 0);
|
||||
}
|
||||
|
||||
if (ov29_0234D7C0(0xC77 + TRY_RECRUIT_MESSAGE_OFFSET,
|
||||
GetMessageLogPreprocessorArgs(), 0, 0, 1) == 2) {
|
||||
ret = FALSE;
|
||||
} else {
|
||||
member.flags = TRUE;
|
||||
member.flags |= 2;
|
||||
member.is_leader = 0;
|
||||
member.level = info->field_0xc;
|
||||
member.iq = 1;
|
||||
member.hidden_power_base_power = info->field_0x44;
|
||||
*(u16 *)&member.hidden_power_type = info->field_0x46;
|
||||
member.tactic = 0;
|
||||
member.member_index = -1;
|
||||
member.team_index = -1;
|
||||
member.id = info->field_0x0;
|
||||
member.joined_at = DUNGEON_PTR[0]->id;
|
||||
member.joined_at_floor = DUNGEON_PTR[0]->floor;
|
||||
member.current_hp = info->field_0x6;
|
||||
member.max_hp = info->field_0x6;
|
||||
member.belly = info->field_0x14;
|
||||
member.belly_thousandths = info->field_0x16;
|
||||
member.max_belly = info->field_0x18;
|
||||
member.max_belly_thousandths = info->field_0x1a;
|
||||
for (i = 0; i < 2; i++) {
|
||||
member.offensive_stats[i] = info->field_0x8[i];
|
||||
member.defensive_stats[i] = info->field_0xa[i];
|
||||
}
|
||||
member.exp = info->field_0x10;
|
||||
*(struct moves *)member.moves = info->field_0x22;
|
||||
member.held_item = info->field_0x1c;
|
||||
StrncpyName(member.name, (const char *)GetNameString((enum monster_id)info->field_0x0), 10);
|
||||
EnableAllLearnableIqSkills(member.iq_skill_flags, (s16)member.id,
|
||||
(s16)member.iq);
|
||||
recolored = name_buf1;
|
||||
#ifdef JAPAN
|
||||
StrcpySimple((unsigned char *)keyboard_buf, (const unsigned char *)member.name);
|
||||
#else
|
||||
StrncpySimpleNoPad((unsigned char *)keyboard_buf,
|
||||
(const unsigned char *)member.name, 10);
|
||||
#endif
|
||||
ov29_022EACAC();
|
||||
if (ov29_0234D7C0(0xC7B + TRY_RECRUIT_MESSAGE_OFFSET,
|
||||
GetMessageLogPreprocessorArgs(), 0, 0, 1) == 1) {
|
||||
ov29_0234D838();
|
||||
while (!DungeonModeSetupAndShowNameKeyboard(member.name, keyboard_buf, 0))
|
||||
;
|
||||
}
|
||||
GetRecoloredTeamMemberName(recolored, &member);
|
||||
SetMessageLogPreprocessorArgsString(0, recolored);
|
||||
SetPreprocessorArgsIdVal(1, 0);
|
||||
ov29_0230E658(0xC7E + TRY_RECRUIT_MESSAGE_OFFSET);
|
||||
RemoveMonsterFromTile(recruit, info->field_0x2, info->field_0x4);
|
||||
if (!ov29_0230E5A8(user, recruit, info->field_0x2, info->field_0x4)) {
|
||||
idx = ov29_0230E5FC(&member, -1);
|
||||
while (!ov29_0230E5A8(user, recruit, info->field_0x2, info->field_0x4)) {
|
||||
ov29_0230E658(0xC7F + TRY_RECRUIT_MESSAGE_OFFSET);
|
||||
do {
|
||||
ov29_0234D838();
|
||||
ent = ov29_0234EE10(recruit, member.name);
|
||||
if (ent == NULL)
|
||||
break;
|
||||
if (ent == recruit) {
|
||||
GetRecoloredTeamMemberName(name_buf2, &member);
|
||||
} else {
|
||||
GetRecoloredNameOfTeamMemberAtIdx(
|
||||
name_buf2, ((struct monster *)ent->info)->team_index);
|
||||
}
|
||||
SetMessageLogPreprocessorArgsString(0, name_buf2);
|
||||
SubstitutePlaceholderStringTags(1, user, 0);
|
||||
response = ov29_0234D7C0(0xC80 + TRY_RECRUIT_MESSAGE_OFFSET,
|
||||
GetMessageLogPreprocessorArgs(), 0, 0, 1);
|
||||
} while (response == -1);
|
||||
if (response != 2 && ent != NULL) {
|
||||
ov29_0230E658(0xC81 + TRY_RECRUIT_MESSAGE_OFFSET);
|
||||
ov29_022E68BC(ent);
|
||||
HandleFaint(ent, DAMAGE_SOURCE_TRANSFORM_FRIEND, user);
|
||||
if (ent == recruit) {
|
||||
ret = TRUE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!GetFlag(GetActiveTeamMember(i)->flags, 1))
|
||||
break;
|
||||
}
|
||||
member.team_index = i;
|
||||
member.member_index = ov29_0230E5FC(&member, idx);
|
||||
sub_02056698(i, member.member_index);
|
||||
HandleFaint(recruit, DAMAGE_SOURCE_TRANSFORM_FRIEND, user);
|
||||
slot = GetActiveTeamMember(i);
|
||||
*slot = member;
|
||||
ov29_022E8104();
|
||||
ov29_022E81F8();
|
||||
InitTeamMember(info->field_0x0, info->field_0x2, info->field_0x4, slot,
|
||||
&out, FALSE, TRUE, TRUE, TRUE);
|
||||
SetPokemonJoined((s16)slot->id);
|
||||
ov29_022E8104();
|
||||
ov29_022E81F8();
|
||||
spawned = out;
|
||||
ret = TRUE;
|
||||
}
|
||||
done:
|
||||
ov29_0234D8A0(1);
|
||||
if (!ret)
|
||||
LogMessageByIdWithPopupCheckUser(user, 0xC78 + TRY_RECRUIT_MESSAGE_OFFSET);
|
||||
if (spawned != NULL)
|
||||
EnsureCanStandCurrentTile(spawned);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -59,3 +59,23 @@ s32 RandRange(s32 x, s32 y) {
|
||||
u32 Rand32Bit() {
|
||||
return (Rand16Bit() << 0x10) | Rand16Bit();
|
||||
}
|
||||
|
||||
void sub_020022C4(u32 *param_1)
|
||||
{
|
||||
*param_1 = 1;
|
||||
}
|
||||
|
||||
u32 sub_020022D0(u32 *param_1, u32 param_2)
|
||||
{
|
||||
u32 value = *param_1 * 0x5D588B65 + 1;
|
||||
*param_1 = value;
|
||||
return ((value >> 0x10) * param_2) >> 0x10;
|
||||
}
|
||||
|
||||
s32 RandIntSafe(s32 n)
|
||||
{
|
||||
s32 entropy = Rand16Bit();
|
||||
entropy &= 0xFFFF;
|
||||
entropy *= n;
|
||||
return entropy >> 0x10;
|
||||
}
|
||||
|
||||
@@ -78,3 +78,42 @@ int StrncmpSimple(const unsigned char* s1, const unsigned char* s2, s32 n)
|
||||
} while (bytes_compared < n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef JAPAN
|
||||
struct unk_020B112C {
|
||||
const u16 *field_0x0;
|
||||
const u8 (*field_0x4)[2];
|
||||
};
|
||||
extern const struct unk_020B112C _020B112C_JP;
|
||||
#endif
|
||||
|
||||
u16 sub_020251F0(u8 c)
|
||||
{
|
||||
#ifdef JAPAN
|
||||
const u8 *row = _020B112C_JP.field_0x4[c];
|
||||
return (row[0] << 8) + row[1];
|
||||
#else
|
||||
return c;
|
||||
#endif
|
||||
}
|
||||
|
||||
void StrncpySimpleNoPadSafe(unsigned char* dest, const unsigned char* src, s32 n)
|
||||
{
|
||||
while (n-- > 0 && *src != 0) {
|
||||
#ifdef JAPAN
|
||||
u16 c = sub_020251F0(*src++);
|
||||
dest[0] = c >> 8;
|
||||
dest[1] = c;
|
||||
dest += 2;
|
||||
#else
|
||||
u32 c = *src++;
|
||||
if (c < 0x100) {
|
||||
*dest++ = c;
|
||||
}
|
||||
else {
|
||||
*dest++ = ' ';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
*dest = 0;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
#include "main_02026174.h"
|
||||
|
||||
struct unk_02020B60 {
|
||||
s32 field_0x0;
|
||||
s32 field_0x4;
|
||||
};
|
||||
|
||||
extern void sub_02020B60(void *p, struct unk_02020B60 *pos);
|
||||
extern void AnalyzeText(void *p);
|
||||
extern void sub_02020D7C(void *p, void *dst);
|
||||
extern void sub_02025E84(struct unk_02026130 *p, s32 window_id);
|
||||
|
||||
|
||||
extern void sub_02020B74(void *p);
|
||||
|
||||
extern void sub_02020BB8(void *p);
|
||||
|
||||
extern void sub_02020BC4(void *p);
|
||||
extern void sub_02020BC4(void *p, u32 flags, char *string);
|
||||
|
||||
extern void sub_02020CCC(void *p);
|
||||
|
||||
@@ -27,9 +37,9 @@ void sub_02026184(struct unk_02026130* p)
|
||||
sub_02020BB8((void *) p + 4);
|
||||
}
|
||||
|
||||
void sub_02026194(struct unk_02026130* p)
|
||||
void sub_02026194(struct unk_02026130* p, u32 flags, char* string)
|
||||
{
|
||||
sub_02020BC4((void *) p + 4);
|
||||
sub_02020BC4((void *) p + 4, flags, string);
|
||||
}
|
||||
|
||||
void sub_020261A4(struct unk_02026130* p)
|
||||
@@ -56,3 +66,26 @@ void sub_020261E4(struct unk_02026130* p)
|
||||
{
|
||||
sub_02020D5C((void *) p + 4);
|
||||
}
|
||||
|
||||
void sub_020261F4(struct unk_02026130* p, void* dst)
|
||||
{
|
||||
sub_02020D7C((void *) p + 4, dst);
|
||||
}
|
||||
|
||||
void sub_02026204(struct unk_02026130* p)
|
||||
{
|
||||
AnalyzeText((void *) p + 4);
|
||||
}
|
||||
|
||||
void DrawTextInWindow(s32 window_id, s32 x, s32 y, char* string)
|
||||
{
|
||||
struct unk_02020B60 pos;
|
||||
struct unk_02026130 state;
|
||||
|
||||
pos.field_0x0 = x;
|
||||
pos.field_0x4 = y;
|
||||
sub_02025E84(&state, window_id);
|
||||
sub_02020B60(state.field_0x4, &pos);
|
||||
sub_02020BC4(state.field_0x4, 0xC402, string);
|
||||
AnalyzeText(state.field_0x4);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "main_0202B558.h"
|
||||
#include "main_0202AAA8.h"
|
||||
#include "main_0202A66C.h"
|
||||
#include "main_0203258C.h"
|
||||
|
||||
s32 GetSimpleMenuField0x1A4(s32 window_id)
|
||||
{
|
||||
@@ -7,3 +9,25 @@ s32 GetSimpleMenuField0x1A4(s32 window_id)
|
||||
|
||||
return menu->field_0x1A4;
|
||||
}
|
||||
|
||||
s32 sub_0202B568(s32 window_id)
|
||||
{
|
||||
return GetMaxItemsOnPage(GetWindowContents(window_id) + 4);
|
||||
}
|
||||
|
||||
s32 GetSimpleMenuResult__0202B870(s32 window_id)
|
||||
{
|
||||
struct unk_0202AAA8 *menu = GetWindowContents(window_id);
|
||||
struct unk_0202A75C *items = menu->field_0x198;
|
||||
s32 idx;
|
||||
|
||||
if (menu->field_0x1A0 != 0) {
|
||||
if (menu->field_0x1A1 != 0) {
|
||||
idx = GetTotalNumMenuItems((void *)menu + 4);
|
||||
} else {
|
||||
idx = GetSelectedMenuItemIdx((void *)menu + 4);
|
||||
}
|
||||
return items[idx].field_0x100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "script_variable.h"
|
||||
#include "main_020517D4.h"
|
||||
#include "main_0202A66C.h"
|
||||
#include "main_0200224C.h"
|
||||
#include "main_0202B558.h"
|
||||
|
||||
struct unk_020AFE74 {
|
||||
s32 field_0x0;
|
||||
@@ -70,8 +72,6 @@ extern void MaybeGetColoredFormattedItemName(void*, struct item*, void*);
|
||||
extern s8 CreateSimpleMenuFromStringIds(void*, s32, s32, void*, s32);
|
||||
extern void GetNameWithGender(char *dst, s16 monster_id, char color_id);
|
||||
extern void GetNameRaw(unsigned char *, s32);
|
||||
extern void StrncpySimpleNoPadSafe(u8* dest, const u8* src, u32 n);
|
||||
extern s32 GetSimpleMenuResult__0202B870(s8);
|
||||
extern s32 GetSimpleMenuResult__0202AEA4(s8);
|
||||
extern void InitPreprocessorArgs(struct preprocessor_args* args);
|
||||
extern bool8 IsMonsterIllegalForMissions(enum monster_id);
|
||||
@@ -101,7 +101,6 @@ extern void ApplyLevelUpBoostsToGroundMonster(void *mon, s16 levels, s32 flag);
|
||||
extern void sub_02050C10(s32 delta);
|
||||
extern void sub_0203909C(u8 *name);
|
||||
extern void ShowKeyboard(s32 mode, u8 *, s32, u8 *);
|
||||
extern s32 RandIntSafe(s32 n);
|
||||
extern void ov11_023061CC(void *);
|
||||
extern void ov11_023061E4(void *, s32);
|
||||
extern void ov11_02310BDC(void);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#include "main_020502B0.h"
|
||||
#include "adventure_log.h"
|
||||
#include "item_util_1.h"
|
||||
#include "main_0204FB9C.h"
|
||||
#include "progression.h"
|
||||
|
||||
extern s32 NormalizeTreasureBox(s32 item_id);
|
||||
|
||||
void IncrementNbFainted(void)
|
||||
{
|
||||
@@ -13,3 +18,27 @@ u32 GetNbFainted(void)
|
||||
{
|
||||
return ADVENTURE_LOG_PTR->nb_faints;
|
||||
}
|
||||
|
||||
void SetItemAcquired(struct item *item)
|
||||
{
|
||||
s32 id = NormalizeTreasureBox(item->id);
|
||||
if (!IsItemValidVeneer(id)) {
|
||||
return;
|
||||
}
|
||||
if (id >= 0x3B && id <= 0x41) {
|
||||
s32 all = 1;
|
||||
s32 i;
|
||||
SetAdventureLogCompleted((u8) (id - 0x21));
|
||||
for (i = 0x1A; i <= 0x20; i++) {
|
||||
if (!GetAdventureLogCompleted((u8) i)) {
|
||||
all = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (all) {
|
||||
SetResolvedPerformanceProgressFlag(0x15, 1);
|
||||
}
|
||||
}
|
||||
ADVENTURE_LOG_PTR->items_acquired_flags[id / 32] |= 1 << (id % 32);
|
||||
ADVENTURE_LOG_PTR->completion_flags[0] |= 8;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#include "main_020514CC.h"
|
||||
#include "util.h"
|
||||
#include "enums.h"
|
||||
#include "dungeon.h"
|
||||
#include "main_0200224C.h"
|
||||
|
||||
extern u8 GetNbFloorsPlusOne(enum dungeon_id dungeon_id);
|
||||
extern s32 GetItemIdFromList(s32 list_idx, s32 a, s32 b);
|
||||
extern void DungeonFloorToGroupFloor(struct dungeon_floor_pair *out, struct dungeon_floor_pair *pair);
|
||||
extern const struct dungeon_floor_pair MISSION_FLOORS_FORBIDDEN[];
|
||||
|
||||
bool32 IsDojoDungeon(u8 dungeon_id)
|
||||
{
|
||||
@@ -15,3 +22,37 @@ bool32 IsFutureDungeon(u8 dungeon_id) {
|
||||
bool32 IsSpecialEpisodeDungeon(u8 dungeon_id) {
|
||||
return dungeon_id >= DUNGEON_STAR_CAVE_SE1 && dungeon_id <= DUNGEON_SPRING_CAVE_PIT;
|
||||
}
|
||||
|
||||
s32 RetrieveFromItemList1(struct dungeon_floor_pair *pair, s32 list_idx)
|
||||
{
|
||||
s32 rnd1 = RandIntSafe(9999);
|
||||
s32 rnd2 = RandIntSafe(9999);
|
||||
enum dungeon_id dungeon_id = pair->dungeon_id;
|
||||
|
||||
if (dungeon_id >= DUNGEON_NORMAL_FLY_MAZE &&
|
||||
dungeon_id >= DUNGEON_DOJO_0xD3) {
|
||||
return ITEM_PLAIN_SEED;
|
||||
}
|
||||
if (pair->floor_id >= GetNbFloorsPlusOne(dungeon_id)) {
|
||||
return ITEM_PLAIN_SEED;
|
||||
}
|
||||
return GetItemIdFromList(list_idx, rnd1, rnd2);
|
||||
}
|
||||
|
||||
bool8 IsForbiddenFloor(struct dungeon_floor_pair *pair)
|
||||
{
|
||||
struct dungeon_floor_pair group;
|
||||
s32 i;
|
||||
|
||||
DungeonFloorToGroupFloor(&group, pair);
|
||||
for (i = 0; ; i++) {
|
||||
if (MISSION_FLOORS_FORBIDDEN[i].dungeon_id == 100) {
|
||||
break;
|
||||
}
|
||||
if (group.dungeon_id == MISSION_FLOORS_FORBIDDEN[i].dungeon_id &&
|
||||
group.floor_id == MISSION_FLOORS_FORBIDDEN[i].floor_id) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
#include "save.h"
|
||||
#include "main_0202593C.h"
|
||||
#include "main_02058FA4.h"
|
||||
#include "main_020251AC.h"
|
||||
|
||||
extern struct team_member_table *TEAM_MEMBER_TABLE_PTR;
|
||||
|
||||
extern s32 GetLanguageType(void);
|
||||
extern void StrncpySimpleNoPadSafe(u8* dest, const u8* src, u32 n);
|
||||
extern void InitBitstreamForRead(struct bitstream *ptr, void *start_addr, u32 total_len);
|
||||
extern void WriteMonsterToSave(struct bitstream *stream, struct ground_monster *monster);
|
||||
extern void CopyBitsTo(void *ctx, void *src, s32 nbits);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "main_0205E01C.h"
|
||||
#include "main_0205E288.h"
|
||||
#include "dungeon_recruitment_2.h"
|
||||
#include "main_020514CC.h"
|
||||
|
||||
extern u8 _020A39C0;
|
||||
extern u8 _020A39D4;
|
||||
@@ -26,7 +27,6 @@ extern const char _020A3AD4[];
|
||||
extern const char _020A3AF4[];
|
||||
extern const char _020A3B18[];
|
||||
|
||||
extern s32 RandIntSafe(s32 n);
|
||||
extern void ClearMissionData(struct mission *mission);
|
||||
extern struct mission_deliver_list MISSION_DELIVER_LIST_PTR;
|
||||
extern s32 CanDungeonBeUsedForMission(enum dungeon_id);
|
||||
@@ -45,7 +45,6 @@ extern s16 *sub_020627F4(void);
|
||||
|
||||
extern enum monster_id GetBaseForm(enum monster_id);
|
||||
extern s32 GetBodySize(enum monster_id);
|
||||
extern bool8 IsForbiddenFloor(struct dungeon_floor_pair*);
|
||||
extern bool8 IsInvalidForMission(enum dungeon_id);
|
||||
extern bool8 IsItemValidVeneer(s16 item_id);
|
||||
extern bool8 IsMissionValid(struct mission *mission);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "enums.h"
|
||||
#include "main_020251AC.h"
|
||||
|
||||
extern void StrncpySimpleNoPadSafe(u8 *dest, const u8 *src, u32 n);
|
||||
|
||||
extern u8 _022B7310[];
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
#include "main_02001188.h"
|
||||
#include "common.h"
|
||||
#include <stdarg.h>
|
||||
#include "main_020251AC.h"
|
||||
#include "main_020502B0.h"
|
||||
#include "main_02026174.h"
|
||||
#include "main_0202B558.h"
|
||||
extern void sub_02056094(char *dst, struct ground_monster *ground_monster,
|
||||
bool8 is_leader);
|
||||
|
||||
@@ -40,7 +44,6 @@ struct unk_02324D90 {
|
||||
|
||||
extern struct unk_02324D90 *ov11_02324D90;
|
||||
extern char ov11_02322DB8[];
|
||||
extern void StrncpySimpleNoPadSafe(u8 *dest, const u8 *src, u32 n);
|
||||
extern s32 sub_02055894(struct ground_monster *member);
|
||||
extern bool8 sub_020564B0(int idx);
|
||||
extern s32 vsprintf(u8 *str, const u8 *format, va_list ap);
|
||||
@@ -107,10 +110,10 @@ extern s32 ov11_02322D60;
|
||||
extern s32 ov11_02322D88;
|
||||
extern u8 ov11_02322DB0[];
|
||||
|
||||
extern void CloseScrollBox(s8); extern void CloseTextBox2(s8); extern u8 CreateParentMenuFromStringIds(void *, u32, void *, void *); extern s8 CreateScrollBoxSingle(void *, s32, s32, s32, void *, s32, void *); extern s8 CreateSimpleMenuFromStringIds(void *, s32, s32, void *, s32); extern s8 CreateTextBox(void *, void *); extern void DrawTextInWindow(s32 window_id, s32 x, s32 y, char *string);
|
||||
extern void CloseScrollBox(s8); extern void CloseTextBox2(s8); extern u8 CreateParentMenuFromStringIds(void *, u32, void *, void *); extern s8 CreateScrollBoxSingle(void *, s32, s32, s32, void *, s32, void *); extern s8 CreateSimpleMenuFromStringIds(void *, s32, s32, void *, s32); extern s8 CreateTextBox(void *, void *);
|
||||
extern struct team_member *GetActiveTeamMember(s32 roster_idx);
|
||||
extern void GetPressedButtons(u32, u16 *);
|
||||
extern s32 GetSimpleMenuResult__0202AEA4(s8); extern s32 GetSimpleMenuResult__0202B870(s8); extern struct ground_monster *GetTeamMember(s32 member_idx);
|
||||
extern s32 GetSimpleMenuResult__0202AEA4(s8);extern struct ground_monster *GetTeamMember(s32 member_idx);
|
||||
extern void InitPreprocessorArgs(struct preprocessor_args *);
|
||||
extern s32 IsScrollBoxActive(s8); extern void ShowDialogueBox(s8); extern void ShowStringIdInDialogueBox(s8, s32, s32, void *); extern void ov11_022DC504(void);
|
||||
extern u8 *strcpy(u8 *dest, const u8 *src);
|
||||
@@ -118,7 +121,6 @@ extern u8 *strcpy(u8 *dest, const u8 *src);
|
||||
extern s8 CreateInventoryMenuOuter(s32, s32, s32, void *, void *, void *, u8);
|
||||
extern bool8 IsBagNotEmpty(void);
|
||||
extern u8 PopInventoryMenuField0x1A3(s32 window_id);
|
||||
extern void SetItemAcquired(struct item *);
|
||||
extern void SortItemsInBag(void);
|
||||
extern void *memcpy(void *, const void *, u32);
|
||||
extern int ov11_023090DC(void);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "overlay_17_0238B10C.h"
|
||||
#include "enums.h"
|
||||
#include "main_0202B558.h"
|
||||
|
||||
extern void ov17_0238A278(void);
|
||||
|
||||
@@ -7,7 +8,6 @@ extern struct unk_0238BE00 *OVERLAY17_UNKNOWN_POINTER__NA_238BE00;
|
||||
|
||||
extern u32 IsSimpleMenuActive(s32 window_id);
|
||||
|
||||
extern s32 GetSimpleMenuResult__0202B870(s8 window_id);
|
||||
|
||||
extern void ov17_0238B028(s32 a);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "overlay_18_0238BF60.h"
|
||||
#include "overlay_18_0238C950.h"
|
||||
#include "main_0202B558.h"
|
||||
|
||||
extern void ov18_0238BE28(s32 a);
|
||||
|
||||
extern u32 IsSimpleMenuActive(s32 window_id);
|
||||
|
||||
extern s32 GetSimpleMenuResult__0202B870(s8 window_id);
|
||||
|
||||
extern struct unk_0238C950 *LINK_SHOP_PTR;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "overlay_24.h"
|
||||
#include "main_0203D538.h"
|
||||
#include "main_020251AC.h"
|
||||
#include "main_0202B558.h"
|
||||
|
||||
extern void CloseCollectionMenu(s8);
|
||||
extern void CloseDialogueBox(s8);
|
||||
@@ -7,12 +9,10 @@ extern void FreeMissionRewardStructMain();
|
||||
extern s32 GetEggHatchTimer();
|
||||
extern s32 GetKeyboardStatus();
|
||||
extern const u8 *GetKeyboardStringResult();
|
||||
extern s32 GetSimpleMenuResult__0202B870(s8);
|
||||
extern void HidePortraitBox(s8);
|
||||
extern s32 IsDialogueBoxActive(s8);
|
||||
extern void ShowDialogueBox(s8);
|
||||
extern void StrcpySimple(unsigned char* dest, const unsigned char* src);
|
||||
extern void StrncpySimpleNoPadSafe(u8* dest, const u8* src, u32 n);
|
||||
extern void ov11_022DC504();
|
||||
extern struct overlay_24_unk1E8_sub *ov11_02306C64();
|
||||
extern s32 ov11_02306C9C();
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "main_0200C4FC.h"
|
||||
#include "item.h"
|
||||
#include "main_02001188.h"
|
||||
#include "main_02026174.h"
|
||||
#include "main_0202B558.h"
|
||||
|
||||
|
||||
extern void CloseDialogueBox(s8);
|
||||
@@ -13,7 +15,6 @@ extern void CloseTextBox(s8);
|
||||
extern s32 GetMoneyCarried();
|
||||
extern s32 GetNbItemsInBag();
|
||||
extern void GetPressedButtons(void *, u16*);
|
||||
extern s32 GetSimpleMenuResult__0202B870(s8);
|
||||
extern void HidePortraitBox(s8);
|
||||
extern s32 IsDialogueBoxActive(s8);
|
||||
extern s32 IsScrollBoxActive(s8);
|
||||
@@ -58,7 +59,6 @@ extern void ReturnScriptMenuResultZero(void);
|
||||
extern void UpdateWindow(char *);
|
||||
extern void sub_02027B1C(char *);
|
||||
extern void AppendStandardStringToMission(char *, s32, s32, s32);
|
||||
extern void DrawTextInWindow(char *, s32, s32, void*);
|
||||
|
||||
extern s32 APPRAISAL_MAIN_MENU_ITEMS;
|
||||
extern s32 APPRAISAL_MENU_ITEMS_CONFIRM;
|
||||
@@ -617,6 +617,6 @@ void ov25_0238B414(char *output)
|
||||
#else
|
||||
AppendStandardStringToMission(output, 4, 2, 0x225);
|
||||
#endif
|
||||
DrawTextInWindow(output, 0x10, 0x10, buffer);
|
||||
DrawTextInWindow((s32)output, 0x10, 0x10, buffer);
|
||||
UpdateWindow(output);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "dungeon_util_2.h"
|
||||
#include "overlay_29_022EC7E8.h"
|
||||
#include "overlay_29_022E9FC0.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
#ifdef JAPAN
|
||||
#define SET_LEADER_ACTION_DATA_OFFSET -0x2C1
|
||||
@@ -62,7 +63,6 @@ extern void GetPressedButtons(u32 param_1, u16 *pressed);
|
||||
extern s32 HasStatusThatPreventsLeaderActing();
|
||||
extern s32 HideTileGrid();
|
||||
extern s32 LogItemBlockedByEmbargo();
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
extern s32 MonsterHasEmbargoStatus();
|
||||
extern s32 OpenMenu(bool8 a, u8 b, s32 c);
|
||||
extern s32 OpenMessageLog();
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "overlay_29_022E3F20.h"
|
||||
#include "dungeon.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
extern s32 GetIdleAnimationId(struct entity *entity);
|
||||
extern int ov29_02304830();
|
||||
extern void TryRemoveSnatchedMonsterFromDungeonStruct(struct entity *user, struct entity *target);
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
#include "overlay_29_022ECDC0.h"
|
||||
#include "overlay_29_022E45B8.h"
|
||||
#include "overlay_29_0231E9F0.h"
|
||||
#include "overlay_29_0230F8AC.h"
|
||||
#include "overlay_29_0231EDD8.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
struct unk_023535DC {
|
||||
u8 field_0x0;
|
||||
@@ -79,7 +82,6 @@ extern void ActivateMotorDrive(struct entity* entity);
|
||||
extern void ApplyDamageAndEffectsWrapper(struct entity *entity, s32 damage, s32 a, s32 b);
|
||||
extern bool8 IsEitherMonsterInvalid(struct entity *a, struct entity *b);
|
||||
extern void ResetDamageData(struct unk_02308FE0 *damage_data);
|
||||
extern void TryHurl(struct entity *user, struct entity *target);
|
||||
extern void ov29_022E57D4(struct entity *entity);
|
||||
extern void ov29_022E5E84(struct entity *a, struct entity *b);
|
||||
extern void ov29_0230F728(struct entity *attacker, struct entity *defender, enum exclusive_item_effect_id effect_id, s32 a);
|
||||
@@ -113,7 +115,6 @@ extern struct team_member* GetActiveTeamMember(s32 roster_idx);
|
||||
extern s32 GetIdleAnimationId(struct entity *entity);
|
||||
extern void HandleFaint(struct entity *fainted_entity, s32 damage_source, struct entity *killer);
|
||||
extern bool8 IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id);
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
extern void MoveMonsterToPos(struct entity* entity, s32 x_pos, s32 y_pos, bool8 reset_prev_pos_fields);
|
||||
extern s32 PlayEffectAnimationEntity(struct entity *entity, s32 id, s32 a, u8 b, s32 c, s32 d, s32 e, s32 f);
|
||||
extern int PlayMissSfx__022E611C();
|
||||
@@ -124,8 +125,6 @@ extern void RestoreRandomMovePP(struct entity* user, struct entity* target, s32
|
||||
extern void SubInitMonster(struct monster* monster, bool8 flag);
|
||||
extern bool8 TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target);
|
||||
extern void TryIncreaseHp(struct entity *user, struct entity *target, s32 hp, s32 a, bool8 b);
|
||||
extern bool8 TryRecruit(struct entity *user, struct entity *recruit, void *recruit_info);
|
||||
extern void TrySpawnEnemyItemDrop(struct entity* attacker, struct entity* defender);
|
||||
extern void UpdateShopkeeperModeAfterAttack(struct entity* attacker, struct entity* defender);
|
||||
extern s32 abs(s32 n);
|
||||
extern int ov10_022BDC68();
|
||||
@@ -145,7 +144,6 @@ extern int ov29_02307C48();
|
||||
extern int ov29_0230D628();
|
||||
extern int ov29_0230D688();
|
||||
extern int ov29_0230D7D4();
|
||||
extern int ov29_0234B1A4();
|
||||
|
||||
extern struct unk_023528A4 TYPE_DAMAGE_NEGATING_EXCLUSIVE_ITEM_EFFECTS[];
|
||||
extern s16 SET_DAMAGE_STATUS_DAMAGE;
|
||||
|
||||
@@ -43,7 +43,6 @@ extern bool8 AuraBowIsActive(struct entity *entity);
|
||||
extern bool8 FixedPoint64CmpLt(const struct fixed_point_64 *a, const struct fixed_point_64 *b);
|
||||
extern void DivideFixedPoint64(struct fixed_point_64 *out, struct fixed_point_64 *a, struct fixed_point_64 *b);
|
||||
extern void ResetDamageCalcDiagnostics(void);
|
||||
extern bool8 OtherMonsterAbilityIsActive(struct entity *entity, enum ability_id ability_id);
|
||||
extern void MultiplyFixedPoint64(struct fixed_point_64 *out, const struct fixed_point_64 *a, const struct fixed_point_64 *b);
|
||||
extern bool8 UpdateStateFlags(struct monster *info, s32 flag, bool8 value);
|
||||
extern void ResetDamageData(struct unk_02308FE0 *damage_data);
|
||||
|
||||
@@ -5,6 +5,19 @@
|
||||
#include "dungeon_util_static.h"
|
||||
#include "exclusive_item.h"
|
||||
#include "overlay_29_0230F810.h"
|
||||
#include "dg_random.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_pokemon_attributes_1.h"
|
||||
#include "dungeon_recruitment_2.h"
|
||||
#include "overlay_29_02344BE4.h"
|
||||
#include "overlay_29_02345A3C.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
extern const s16 ov10_022C4650;
|
||||
|
||||
extern bool8 TryGenerateUnownStoneDrop(struct item *item, s16 monster_id, s32 param_3);
|
||||
extern bool8 ov29_023460DC(struct item *item, struct entity *entity, bool8 param_3, s32 param_4);
|
||||
extern bool8 ov29_0234908C(struct item *item);
|
||||
|
||||
bool8 ExclusiveItemEffectIsActive__0230F8AC(struct entity *entity, enum exclusive_item_effect_id effect_id)
|
||||
{
|
||||
@@ -39,3 +52,51 @@ bool8 IsMonster__0230F980(struct entity *entity)
|
||||
|
||||
return GetEntityType(entity) == ENTITY_MONSTER;
|
||||
}
|
||||
|
||||
void ov29_0230F9A4(struct entity *entity, struct item *item)
|
||||
{
|
||||
if (!IsMonster__0230F980(entity))
|
||||
return;
|
||||
|
||||
if (GetEntInfo(entity)->is_not_team_member)
|
||||
return;
|
||||
|
||||
ov29_0234908C(item);
|
||||
}
|
||||
|
||||
void TrySpawnEnemyItemDrop(struct entity *attacker, struct entity *defender)
|
||||
{
|
||||
struct item item;
|
||||
struct monster *monster;
|
||||
s16 n;
|
||||
|
||||
if (TreasureBoxDropsEnabled(DUNGEON_PTR->id) &&
|
||||
(monster = GetEntInfo(defender))->is_not_team_member)
|
||||
{
|
||||
n = 0;
|
||||
if (GetEntityType(attacker) == ENTITY_MONSTER)
|
||||
{
|
||||
if (IqSkillIsEnabled(attacker, IQ_COLLECTOR))
|
||||
n++;
|
||||
if (ExclusiveItemEffectIsActive__0230F8AC(attacker, EXCLUSIVE_EFF_MORE_TREASURE_DROPS))
|
||||
n++;
|
||||
}
|
||||
|
||||
if (TryGenerateUnownStoneDrop(&item, monster->id, n))
|
||||
{
|
||||
SpawnDroppedItemWrapper(defender, &defender->pos, &item, 1);
|
||||
}
|
||||
else if (ov29_023460DC(&item, defender,
|
||||
AbilityIsActiveVeneer(attacker, ABILITY_HONEY_GATHER), n))
|
||||
{
|
||||
SpawnDroppedItemWrapper(defender, &defender->pos, &item, 1);
|
||||
}
|
||||
else if (IsMonster__0230F980(attacker) &&
|
||||
ExclusiveItemEffectIsActive__0230F8AC(attacker, EXCLUSIVE_EFF_MORE_MONEY_DROPS) &&
|
||||
DungeonRandOutcome__022EAB20(ov10_022C4650))
|
||||
{
|
||||
GenerateStandardItem(&item, ITEM_POKE, 2);
|
||||
SpawnDroppedItemWrapper(defender, &defender->pos, &item, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "overlay_29_022E99F0.h"
|
||||
#include "overlay_29_02305C04.h"
|
||||
#include "overlay_29_022E4338.h"
|
||||
#include "overlay_29_0231B194.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
extern s16 ov10_022C4BE4[20];
|
||||
extern void ov29_0230FB30(struct entity *entity);
|
||||
@@ -61,14 +63,12 @@ extern bool8 ov29_022E34A8_EU(struct entity *entity);
|
||||
extern void ApplyDamageAndEffectsWrapper(struct entity *entity, s32 damage, s32 a, s32 b);
|
||||
extern bool8 TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target);
|
||||
extern bool8 ExclusiveItemEffectIsActiveWithLogging(struct entity *user, struct entity *target, bool8 should_log, s32 message_id, enum exclusive_item_effect_id effect_id);
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
extern void TryIncreaseHp(struct entity *user, struct entity *target, s32 hp, s32 a, bool8 b);
|
||||
extern void TryWarp(struct entity *user, struct entity *target, s32 a, s32 b);
|
||||
extern void MultiplyFixedPoint64(struct fixed_point_64 *out, const struct fixed_point_64 *a, const struct fixed_point_64 *b);
|
||||
extern void ov29_022EA370(s32 a, s32 b);
|
||||
extern s32 ov29_022F2FE4();
|
||||
|
||||
extern void WaitUntilAlertBoxTextIsLoadedWrapper(void);
|
||||
extern void EnsureCanStandCurrentTile(struct entity *entity);
|
||||
extern void ov29_022E543C(struct entity *entity);
|
||||
extern void ov29_022E53F0(struct entity *entity);
|
||||
@@ -76,7 +76,6 @@ extern void ov29_022F42F8(struct entity *entity);
|
||||
extern void EndMagnetRiseStatus(struct entity *user, struct entity *target);
|
||||
extern void ov29_022EC62C(struct entity *entity);
|
||||
extern void ov29_022FB718(struct entity *entity);
|
||||
extern void TryActivateBadDreams(struct entity *entity);
|
||||
extern void TryWeatherFormChange(struct entity *entity);
|
||||
extern s32 EndNegativeStatusCondition(struct entity *user, struct entity *target, bool8 a, bool8 b, bool8 c);
|
||||
extern s32 DisplayActions(s32 a);
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
#include "overlay_29_0231B194.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_visibility.h"
|
||||
#include "overlay_29_0231B318.h"
|
||||
#include "overlay_29_0234B024.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
extern const s16 ov10_022C4530;
|
||||
extern void ApplyDamageAndEffectsWrapper(struct entity *entity, s32 damage, s32 a, s32 b);
|
||||
extern bool8 TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target);
|
||||
|
||||
bool8 EntityIsValid__0231B194(struct entity *entity)
|
||||
{
|
||||
@@ -8,3 +17,43 @@ bool8 EntityIsValid__0231B194(struct entity *entity)
|
||||
|
||||
return GetEntityType(entity) != ENTITY_NOTHING;
|
||||
}
|
||||
|
||||
void TryActivateBadDreams(struct entity *attacker)
|
||||
{
|
||||
struct entity *targets[DUNGEON_MAX_POKEMON];
|
||||
s16 num_targets;
|
||||
s16 i;
|
||||
struct entity *target;
|
||||
bool8 attacker_is_team_member;
|
||||
|
||||
num_targets = 0;
|
||||
attacker_is_team_member = GetEntInfo(attacker)->is_not_team_member == 0;
|
||||
|
||||
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
|
||||
target = DUNGEON_PTR->active_monster_ptrs[i];
|
||||
if (!IsMonster__0231B318(target))
|
||||
continue;
|
||||
if (attacker_is_team_member) {
|
||||
if (!GetEntInfo(target)->is_not_team_member)
|
||||
continue;
|
||||
} else {
|
||||
if (GetEntInfo(target)->is_not_team_member)
|
||||
continue;
|
||||
}
|
||||
targets[num_targets++] = target;
|
||||
}
|
||||
|
||||
SetPreprocessorArgsIdVal(2, ABILITY_BAD_DREAMS);
|
||||
|
||||
for (i = 0; i < num_targets; i++) {
|
||||
target = targets[i];
|
||||
if (target != NULL && IsMonster__0231B318(target) &&
|
||||
IsValidTargetEntity(attacker, target) && attacker != target &&
|
||||
IsMonsterSleeping(target)) {
|
||||
ApplyDamageAndEffectsWrapper(target, ov10_022C4530, 0x18,
|
||||
DAMAGE_SOURCE_BAD_DREAMS);
|
||||
if (EntityIsValid__0231B194(target))
|
||||
TryEndPetrifiedOrSleepStatus(attacker, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "overlay_29_02345A3C.h"
|
||||
#include "overlay_29_02305C04.h"
|
||||
#include "overlay_29_0234B340.h"
|
||||
#include "overlay_29_0230F8AC.h"
|
||||
|
||||
#ifdef JAPAN
|
||||
#define MESSAGE_BE6 0x925
|
||||
@@ -82,7 +83,6 @@ extern void TryInflictEyedropStatus(struct entity *user, struct entity *target);
|
||||
extern bool8 TryInflictSlipStatus(struct entity *user, struct entity *target);
|
||||
extern void ov29_022E5A00(struct entity *entity, struct item *item);
|
||||
extern void ov29_022E5AE4(struct entity *entity, struct item *item);
|
||||
extern void ov29_0230F9A4(struct entity *entity, struct item *item);
|
||||
extern bool8 ov29_022FB9BC(struct entity *entity);
|
||||
extern void ov29_022F9EA0(struct entity *entity);
|
||||
extern void EnemyEvolution(struct entity *entity);
|
||||
|
||||
@@ -1,5 +1,56 @@
|
||||
#include "overlay_29_0231EDD8.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "dg_object.h"
|
||||
#include "dg_random.h"
|
||||
#include "dungeon_ai_targeting_1.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_pokemon_attributes_1.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_util_2.h"
|
||||
#include "dungeon_visibility.h"
|
||||
#include "main_020018D0.h"
|
||||
#include "moves_1.h"
|
||||
#include "overlay_29_022E272C.h"
|
||||
#include "overlay_29_022E9FC0.h"
|
||||
#include "overlay_29_022EAC7C.h"
|
||||
#include "overlay_29_0231F570.h"
|
||||
#include "overlay_29_02321238.h"
|
||||
#include "overlay_29_0234B340.h"
|
||||
#include "position_util.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef JAPAN
|
||||
#define MESSAGE_E45 0xB86
|
||||
#define MESSAGE_E46 0xB87
|
||||
#define MESSAGE_E47 0xB88
|
||||
#define MESSAGE_E48 0xB89
|
||||
#else
|
||||
#define MESSAGE_E45 0xE45
|
||||
#define MESSAGE_E46 0xE46
|
||||
#define MESSAGE_E47 0xE47
|
||||
#define MESSAGE_E48 0xE48
|
||||
#endif
|
||||
|
||||
struct unk_022E9298 {
|
||||
s32 field_0x0;
|
||||
s32 field_0x4;
|
||||
s32 field_0x8;
|
||||
s32 field_0xc;
|
||||
};
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
extern const s16 HURL_DAMAGE;
|
||||
extern void CalcDamageFixedNoCategory(struct entity *attacker, struct entity *defender, s16 fixed_damage, s32 a, bool8 *flag, s32 b, s32 damage_source, s32 c, s32 d, s32 e);
|
||||
extern void ChangeMonsterAnimation(struct entity *entity, s32 animation_id, s32 direction);
|
||||
extern void ChangeMonsterAnimationToIdle(struct entity *monster, s32 direction);
|
||||
extern void MoveMonsterToPos(struct entity *entity, s32 x_pos, s32 y_pos, bool8 reset_prev_pos_fields);
|
||||
extern void TryWarp(struct entity *user, struct entity *target, s32 a, s32 b);
|
||||
extern bool8 TwoTurnMoveForcedMiss(struct entity *target, struct move *move);
|
||||
extern void ov29_022E9298(struct position *pos, struct unk_022E9298 *bounds, bool8 a);
|
||||
extern void ov29_022EA370(s32 a, s32 b);
|
||||
extern bool8 CannotMoveToTile(struct entity *entity, struct position *pos);
|
||||
extern void ov29_0232033C(struct entity *entity, struct position *pos);
|
||||
|
||||
bool8 EntityIsValid__0231EDD8(struct entity *entity)
|
||||
{
|
||||
@@ -8,3 +59,208 @@ bool8 EntityIsValid__0231EDD8(struct entity *entity)
|
||||
|
||||
return GetEntityType(entity) != ENTITY_NOTHING;
|
||||
}
|
||||
|
||||
void TryHurl(struct entity *user, struct entity *target)
|
||||
{
|
||||
struct position list[40];
|
||||
struct unk_022E9298 bounds;
|
||||
struct position dest;
|
||||
struct pixel_position pixel_pos;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 pass;
|
||||
struct entity *monster;
|
||||
s32 count;
|
||||
s32 dir;
|
||||
s32 end_x;
|
||||
s32 angle;
|
||||
s32 anim_dir;
|
||||
s32 num_frames;
|
||||
s32 px;
|
||||
s32 step_x;
|
||||
s32 step_y;
|
||||
bool8 suction_cups;
|
||||
s32 idx;
|
||||
s32 end_y;
|
||||
struct entity *occupant;
|
||||
|
||||
if (user != target && (user == NULL ? FALSE : (bool8)(GetEntityType(user) == ENTITY_MONSTER)) && AbilityIsActiveVeneer(user, ABILITY_MOLD_BREAKER))
|
||||
suction_cups = FALSE;
|
||||
else
|
||||
suction_cups = AbilityIsActiveVeneer(target, ABILITY_SUCTION_CUPS);
|
||||
|
||||
if (suction_cups) {
|
||||
SubstitutePlaceholderStringTags(0, target, 0);
|
||||
LogMessageByIdWithPopupCheckUserTarget(user, target, MESSAGE_E45);
|
||||
return;
|
||||
}
|
||||
|
||||
if (user == target) {
|
||||
SubstitutePlaceholderStringTags(0, target, 0);
|
||||
LogMessageByIdWithPopupCheckUserTarget(user, target, MESSAGE_E46);
|
||||
return;
|
||||
}
|
||||
|
||||
dest = target->pos;
|
||||
count = 0;
|
||||
|
||||
for (pass = 0; pass < 2; pass++) {
|
||||
count = 0;
|
||||
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
|
||||
monster = DUNGEON_PTR[0]->active_monster_ptrs[i];
|
||||
if (!EntityIsValid__0231F570(monster) || user == monster || target == monster)
|
||||
continue;
|
||||
if (!CanSeeTarget(user, monster))
|
||||
continue;
|
||||
if (pass == 0) {
|
||||
if (GetTreatmentBetweenMonsters(user, monster, FALSE, TRUE) !=
|
||||
TREATMENT_TREAT_AS_ENEMY)
|
||||
continue;
|
||||
} else {
|
||||
if (GetTreatmentBetweenMonsters(user, monster, FALSE, TRUE) !=
|
||||
TREATMENT_TREAT_AS_ALLY)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pass == 0) {
|
||||
struct position pos;
|
||||
|
||||
for (j = 0; j < NUM_DIRECTIONS; j++) {
|
||||
pos.x = monster->pos.x + DIRECTIONS_XY[j].x;
|
||||
pos.y = monster->pos.y + DIRECTIONS_XY[j].y;
|
||||
if (!CannotMoveToTile(target, &pos) &&
|
||||
!(GetTile(pos.x, pos.y)->terrain_flags & 0x800))
|
||||
break;
|
||||
}
|
||||
if (j != NUM_DIRECTIONS && count < 40) {
|
||||
list[count++] = monster->pos;
|
||||
}
|
||||
} else {
|
||||
struct position pos;
|
||||
|
||||
for (j = 0; j < NUM_DIRECTIONS; j++) {
|
||||
pos.x = monster->pos.x + DIRECTIONS_XY[j].x;
|
||||
pos.y = monster->pos.y + DIRECTIONS_XY[j].y;
|
||||
if (!CannotMoveToTile(target, &pos) &&
|
||||
!(GetTile(pos.x, pos.y)->terrain_flags & 0x800) && count < 40) {
|
||||
list[count++] = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (count != 0) {
|
||||
idx = DungeonRandInt(count);
|
||||
dest = list[idx];
|
||||
} else {
|
||||
struct position pos;
|
||||
|
||||
ov29_022E9298(&user->pos, &bounds, HasDropeyeStatus(user));
|
||||
for (j = 0; j < 100; j++) {
|
||||
pos.x = DungeonRandRange(bounds.field_0x0, bounds.field_0x8);
|
||||
pos.y = DungeonRandRange(bounds.field_0x4, bounds.field_0xc);
|
||||
if (!CannotMoveToTile(target, &pos) &&
|
||||
!(GetTile(pos.x, pos.y)->terrain_flags & 0x800)) {
|
||||
dest = pos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j == 100) {
|
||||
LogMessageByIdWithPopupCheckUserTarget(user, target, MESSAGE_E48);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SubstitutePlaceholderStringTags(0, target, 0);
|
||||
LogMessageByIdWithPopupCheckUserTarget(user, target, MESSAGE_E47);
|
||||
if (ShouldDisplayEntityWrapper(target))
|
||||
PlaySeByIdIfNotSilence(0x212);
|
||||
|
||||
anim_dir = GetEntInfo(target)->action.direction;
|
||||
angle = 0;
|
||||
num_frames = Max(dest.x - target->pos.x, dest.y - target->pos.y) * 16;
|
||||
if (num_frames > 80)
|
||||
num_frames = 80;
|
||||
if (num_frames < 10)
|
||||
num_frames = 10;
|
||||
dir = GetDirectionTowardsPosition(&dest, &target->pos);
|
||||
end_x = ((dest.x * 24 + 12) << 8) + (DIRECTIONS_XY[dir].x << 8) / 3;
|
||||
end_y = ((dest.y * 24 + 16) << 8) + (DIRECTIONS_XY[dir].y << 8) / 3;
|
||||
px = target->pixel_pos.x;
|
||||
step_y = (end_y - (s32)target->pixel_pos.y) / num_frames;
|
||||
pixel_pos.x = px;
|
||||
pixel_pos.y = target->pixel_pos.y;
|
||||
i = 0;
|
||||
step_x = (end_x - px) / num_frames;
|
||||
|
||||
while (i < num_frames) {
|
||||
pixel_pos.x += step_x;
|
||||
pixel_pos.y += step_y;
|
||||
UpdateEntityPixelPos(target, &pixel_pos);
|
||||
if (ShouldDisplayEntityWrapper(target)) {
|
||||
target->elevation = SinAbs4096(angle) << 5;
|
||||
AdvanceFrame(0x3B);
|
||||
if (!(i & 3)) {
|
||||
anim_dir &= 7;
|
||||
ChangeMonsterAnimation(target, 6, anim_dir);
|
||||
anim_dir++;
|
||||
}
|
||||
}
|
||||
angle += 0x800 / num_frames;
|
||||
i++;
|
||||
}
|
||||
|
||||
pixel_pos.x = end_x;
|
||||
pixel_pos.y = end_y;
|
||||
target->elevation = 0;
|
||||
UpdateEntityPixelPos(target, &pixel_pos);
|
||||
AdvanceFrame(0x3B);
|
||||
GetEntInfo(target)->action.direction = anim_dir & 7;
|
||||
|
||||
occupant = GetTile(dest.x, dest.y)->monster;
|
||||
if (!EntityIsValid__0231F570(occupant)) {
|
||||
MoveMonsterToPos(target, dest.x, dest.y, TRUE);
|
||||
ov29_02321238(target);
|
||||
return;
|
||||
}
|
||||
|
||||
for (j = 0; j < NUM_DIRECTIONS; j++) {
|
||||
struct position pos;
|
||||
|
||||
pos.x = dest.x + DIRECTIONS_XY[j].x;
|
||||
pos.y = dest.y + DIRECTIONS_XY[j].y;
|
||||
if (!CannotMoveToTile(target, &pos) &&
|
||||
!(GetTile(pos.x, pos.y)->terrain_flags & 0x800)) {
|
||||
dest = pos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == NUM_DIRECTIONS) {
|
||||
TryWarp(user, target, 0, 0);
|
||||
} else {
|
||||
ov29_0232033C(target, &dest);
|
||||
MoveMonsterToPos(target, dest.x, dest.y, TRUE);
|
||||
}
|
||||
|
||||
if (GetEntityType(occupant) == ENTITY_MONSTER) {
|
||||
struct move move;
|
||||
|
||||
InitMove(&move, MOVE_REGULAR_ATTACK);
|
||||
if (!TwoTurnMoveForcedMiss(occupant, &move))
|
||||
CalcDamageFixedNoCategory(user, occupant, HURL_DAMAGE, 0, NULL, 0,
|
||||
DAMAGE_SOURCE_FLYING_MONSTER, 0, 0, 0);
|
||||
if (EntityIsValid__0231F570(occupant))
|
||||
ChangeMonsterAnimationToIdle(occupant, GetEntInfo(occupant)->action.direction);
|
||||
}
|
||||
|
||||
CalcDamageFixedNoCategory(user, target, HURL_DAMAGE, 0, NULL, 0,
|
||||
DAMAGE_SOURCE_KNOCKED_FLYING, 0, 0, 0);
|
||||
if (EntityIsValid__0231F570(target))
|
||||
ChangeMonsterAnimationToIdle(target, GetEntInfo(target)->action.direction);
|
||||
ov29_022EA370(0x1E, 0x3B);
|
||||
ov29_02321238(target);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "overlay_29_0232D1DC.h"
|
||||
#include "move_orb_effects.h"
|
||||
#include "overlay_29_0231EDD8.h"
|
||||
|
||||
extern s32 DealDamage(struct entity *attacker, struct entity *defender, struct move *move, s32 damageMultiplier, enum item_id item_id);
|
||||
|
||||
@@ -11,7 +12,6 @@ extern void RevealStairs(struct entity *user, struct entity *target);
|
||||
|
||||
extern void TryInflictMobileStatus(struct entity *user, struct entity *target);
|
||||
|
||||
extern void TryHurl(struct entity *user, struct entity *target);
|
||||
|
||||
bool8 DoMoveHurl(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id)
|
||||
{
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
#include "dungeon.h"
|
||||
#include "main_0200330C.h"
|
||||
#include "overlay_29_02337CA8.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
extern void ov29_02306D54(struct entity *);
|
||||
|
||||
void ResetGravity(void)
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#include "overlay_29_0234B104.h"
|
||||
#include "main_0200C4FC.h"
|
||||
#include "overlay_29_0234B024.h"
|
||||
#include "main_0202593C.h"
|
||||
#include "overlay_29_022E272C.h"
|
||||
#include "overlay_29_022E9FC0.h"
|
||||
#include "overlay_29_0234B340.h"
|
||||
|
||||
extern void InitPreprocessorArgs(struct preprocessor_args *args);
|
||||
extern void LogMessage(struct entity *user, const char *message, bool8 show_popup);
|
||||
extern void UnkMapRelatedFunc(u32 switch_case, u32 param_2);
|
||||
extern void WaitUntilAlertBoxTextIsLoaded(u32 param_1);
|
||||
extern int FullyCloseAlertBox(void);
|
||||
|
||||
extern struct message_log_info MESSAGE_LOG_INFO;
|
||||
|
||||
@@ -13,3 +23,89 @@ void SetMessageLogPreprocessorArgsSpeakerId0x30000(u32 team_index)
|
||||
{
|
||||
MESSAGE_LOG_INFO.alert_box_info->preprocessor_args.speaker_id = team_index | 0x30000;
|
||||
}
|
||||
|
||||
void ov29_0234B130(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
MESSAGE_LOG_INFO.alert_box_info->message_starts_group[i] = FALSE;
|
||||
}
|
||||
|
||||
MESSAGE_LOG_INFO.alert_box_info->alert_box_window_id = -2;
|
||||
MESSAGE_LOG_INFO.alert_box_info->field_0xcee = 0;
|
||||
MESSAGE_LOG_INFO.alert_box_info->field_0xced = 0;
|
||||
MESSAGE_LOG_INFO.last_user = NULL;
|
||||
MESSAGE_LOG_INFO.should_start_group = TRUE;
|
||||
ov29_0234B1A4(FALSE);
|
||||
InitPreprocessorArgs(&MESSAGE_LOG_INFO.alert_box_info->preprocessor_args);
|
||||
}
|
||||
|
||||
void ov29_0234B1A4(bool8 param_1)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
if (!ov29_022E9FC0())
|
||||
return;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
MESSAGE_LOG_INFO.alert_box_info->alert_box_messages[i][0] = 0;
|
||||
}
|
||||
|
||||
MESSAGE_LOG_INFO.alert_box_info->field_0xc8b = 0;
|
||||
MESSAGE_LOG_INFO.alert_box_info->alert_box_current_idx = 0;
|
||||
MESSAGE_LOG_INFO.alert_box_info->alert_box_current_loaded_idx = 0;
|
||||
MESSAGE_LOG_INFO.alert_box_info->frames_until_close = 0;
|
||||
MESSAGE_LOG_INFO.alert_box_info->field_0xc92 = 4;
|
||||
MESSAGE_LOG_INFO.alert_box_info->loading_status = 0;
|
||||
|
||||
if (FullyCloseAlertBox() && param_1) {
|
||||
UnkMapRelatedFunc(0, 0);
|
||||
AdvanceFrame(11);
|
||||
}
|
||||
}
|
||||
|
||||
void LogMessageByIdWithPopupCheckParticipants(struct entity *user, struct entity *target,
|
||||
u32 message_id, s32 pos, s16 val)
|
||||
{
|
||||
MESSAGE_LOG_INFO.alert_box_info->preprocessor_args.id_vals[pos] = val;
|
||||
|
||||
if (target != NULL && user != NULL) {
|
||||
LogMessageByIdWithPopupCheckUserTarget(user, target, message_id);
|
||||
}
|
||||
else if (user != NULL) {
|
||||
LogMessageByIdWithPopupCheckUser(user, message_id);
|
||||
}
|
||||
}
|
||||
|
||||
void WaitUntilAlertBoxTextIsLoadedWrapper(void)
|
||||
{
|
||||
WaitUntilAlertBoxTextIsLoaded(0x50);
|
||||
}
|
||||
|
||||
void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id)
|
||||
{
|
||||
bool8 display = FALSE;
|
||||
|
||||
if (ShouldDisplayEntityWrapper(user))
|
||||
display = TRUE;
|
||||
|
||||
if (display)
|
||||
LogMessage(user, (char *)StringFromId(message_id), TRUE);
|
||||
}
|
||||
|
||||
void LogMessageWithPopupCheckUser(struct entity *user, const char *message)
|
||||
{
|
||||
bool8 display = FALSE;
|
||||
|
||||
if (ShouldDisplayEntityWrapper(user))
|
||||
display = TRUE;
|
||||
|
||||
if (display)
|
||||
LogMessage(user, message, TRUE);
|
||||
}
|
||||
|
||||
void LogMessageByIdQuiet(struct entity *user, u32 message_id)
|
||||
{
|
||||
LogMessage(user, (char *)StringFromId(message_id), FALSE);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "dungeon_util_2.h"
|
||||
#include "overlay_29_022E9FC0.h"
|
||||
#include "main_0202A66C.h"
|
||||
#include "main_02026174.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
|
||||
@@ -35,7 +36,6 @@ extern u32 GetMoneyCarried(void);
|
||||
extern u32 sub_0204F9E0(void);
|
||||
extern u8* StringFromId(u32);
|
||||
extern void PreprocessString(u8* dst, u32 dsize, const u8* src, u32 flags, struct PPStrValues* ptr);
|
||||
extern void DrawTextInWindow(s32, u32, u32, u8*);
|
||||
|
||||
extern u8* AllocateTemp1024ByteBufferFromPool(void);
|
||||
extern s32 sub_020265A8(u8*); // Measures the text's width in pixels
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "main_02001188.h"
|
||||
#include "main_020282F4.h"
|
||||
#include "overlay_29_022E9FC0.h"
|
||||
#include "main_02026174.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR[];
|
||||
extern struct loc_struct* OVERLAY31_UNKNOWN_POINTER__NA_238A26C;
|
||||
@@ -14,7 +15,6 @@ extern bool8 ov10_022BCD10(s8);
|
||||
extern void CloseInventoryMenu(s8);
|
||||
extern void ov29_0234E988(u8*);
|
||||
extern void CloseTextBox2();
|
||||
extern void DrawTextInWindow(struct window*, u32, u32, u8*);
|
||||
|
||||
u8 ov31_0238372C(struct position* x)
|
||||
{
|
||||
@@ -58,9 +58,9 @@ void ov31_023837C8(void)
|
||||
void ov31_02383854(struct window* w)
|
||||
{
|
||||
#ifdef JAPAN
|
||||
DrawTextInWindow(w, 2, 2, StringFromId(0x1d3e));
|
||||
DrawTextInWindow((s32)w, 2, 2, StringFromId(0x1d3e));
|
||||
#else
|
||||
DrawTextInWindow(w, 2, 2, StringFromId(0x08e6));
|
||||
DrawTextInWindow((s32)w, 2, 2, StringFromId(0x08e6));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "dungeon_statuses.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "dungeon_util_2.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
#ifdef JAPAN
|
||||
#define HAS_STATUS_THAT_PREVENTS_ACTING_OFFSET -0x2C1
|
||||
@@ -20,7 +21,6 @@
|
||||
#define INFATUATED_MESSAGE (0xC2C + HAS_STATUS_THAT_PREVENTS_ACTING_OFFSET)
|
||||
#define BIDE_MESSAGE (0xC2D + HAS_STATUS_THAT_PREVENTS_ACTING_OFFSET)
|
||||
|
||||
extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id);
|
||||
|
||||
bool8 HasStatusThatPreventsActing(struct entity *monster)
|
||||
{
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
#include "type_matchup_table.h"
|
||||
#include "weather.h"
|
||||
#include "overlay_29_0234B340.h"
|
||||
#include "overlay_29_0234B104.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
extern bool8 UpdateStateFlags(struct monster *info, s32 flag, bool8 value);
|
||||
extern void LogMessageByIdWithPopupCheckParticipants(struct entity *user, struct entity *target, u32 message_id, s32 a4, s32 a5);
|
||||
extern void MultiplyFixedPoint64(struct fixed_point_64 *out, const struct fixed_point_64 *a, const struct fixed_point_64 *b);
|
||||
extern bool8 GhostImmunityIsActive(struct entity *attacker, struct entity *defender, s16 target_type_idx);
|
||||
extern bool8 IsTypeIneffectiveAgainstGhost(enum type_id type);
|
||||
|
||||
Reference in New Issue
Block a user