mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Merge pull request #183 from AnonymousRandomPerson/main
Some checks are pending
build / build (push) Waiting to run
Some checks are pending
build / build (push) Waiting to run
Decomped more AI funcs
This commit is contained in:
commit
85bb9d5e1e
|
|
@ -65,7 +65,6 @@
|
|||
.public ov29_02301594
|
||||
.public ov29_02302200
|
||||
.public ov29_023082C4
|
||||
.public ov29_02338350
|
||||
.public ov29_02348D00
|
||||
.public ov29_0235177C
|
||||
.public ov29_02353530
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#pragma once
|
||||
.public _02098D64
|
||||
.public DUNGEON_MOVE_TABLES
|
||||
.public _02098D64
|
||||
|
|
|
|||
2
asm/include/main_020139AC.inc
Normal file
2
asm/include/main_020139AC.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
.public DUNGEON_MOVE_TABLES
|
||||
136
asm/include/overlay_10_022C5938.inc
Normal file
136
asm/include/overlay_10_022C5938.inc
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
#pragma once
|
||||
.public DoMoveAbsorb
|
||||
.public DoMoveAttract
|
||||
.public DoMoveBeatUp
|
||||
.public DoMoveBlastBurn
|
||||
.public DoMoveBlazeKick
|
||||
.public DoMoveBlock
|
||||
.public DoMoveBlowback
|
||||
.public DoMoveBrickBreak
|
||||
.public DoMoveBrine
|
||||
.public DoMoveCaptivate
|
||||
.public DoMoveChargeBeam
|
||||
.public DoMoveCharm
|
||||
.public DoMoveCloseCombat
|
||||
.public DoMoveConfuse
|
||||
.public DoMoveCopycat
|
||||
.public DoMoveCrunch
|
||||
.public DoMoveCrushClaw
|
||||
.public DoMoveCurse
|
||||
.public DoMoveDamageBoostAllStats
|
||||
.public DoMoveDamageBurn10FlameWheel
|
||||
.public DoMoveDamageConfuse10
|
||||
.public DoMoveDamageConfuse30
|
||||
.public DoMoveDamageConstrict10
|
||||
.public DoMoveDamageCringe10
|
||||
.public DoMoveDamageCringe20
|
||||
.public DoMoveDamageCringe30
|
||||
.public DoMoveDamageDrain
|
||||
.public DoMoveDamageEatItem
|
||||
.public DoMoveDamageHpDependent
|
||||
.public DoMoveDamageLowerAccuracy40
|
||||
.public DoMoveDamageLowerSpecialDefense50
|
||||
.public DoMoveDamageLowerSpeed100
|
||||
.public DoMoveDamageLowerSpeed20
|
||||
.public DoMoveDamageMultihitFatigue
|
||||
.public DoMoveDamageParalyze10
|
||||
.public DoMoveDamageParalyze20
|
||||
.public DoMoveDamagePoison18
|
||||
.public DoMoveDamagePoison40
|
||||
.public DoMoveDamageStealItem
|
||||
.public DoMoveDamageWeightDependent
|
||||
.public DoMoveDamageWithRecoil
|
||||
.public DoMoveDamage__02325DC0
|
||||
.public DoMoveDamage__0232A500
|
||||
.public DoMoveDamage__0232B8B0
|
||||
.public DoMoveDamage__0232DD88
|
||||
.public DoMoveDefog
|
||||
.public DoMoveDestinyBond
|
||||
.public DoMoveDoubleEdge
|
||||
.public DoMoveDragonRage
|
||||
.public DoMoveDreamEater
|
||||
.public DoMoveDynamicPunch
|
||||
.public DoMoveEmbargo
|
||||
.public DoMoveEncore
|
||||
.public DoMoveEndeavor
|
||||
.public DoMoveEruption
|
||||
.public DoMoveFacade
|
||||
.public DoMoveFakeOut
|
||||
.public DoMoveFakeTears
|
||||
.public DoMoveFeatherDance
|
||||
.public DoMoveFeint
|
||||
.public DoMoveFireFang
|
||||
.public DoMoveFissure
|
||||
.public DoMoveFlareBlitz
|
||||
.public DoMoveFlatter
|
||||
.public DoMoveFrustration
|
||||
.public DoMoveGastroAcid
|
||||
.public DoMoveGuardSwap
|
||||
.public DoMoveGust
|
||||
.public DoMoveGyroBall
|
||||
.public DoMoveHammerArm
|
||||
.public DoMoveHeadSmash
|
||||
.public DoMoveHeadbutt
|
||||
.public DoMoveHeartSwap
|
||||
.public DoMoveHiddenPower
|
||||
.public DoMoveHornDrill
|
||||
.public DoMoveHurl
|
||||
.public DoMoveIceFang
|
||||
.public DoMoveIronTail
|
||||
.public DoMoveKnockOff
|
||||
.public DoMoveLastResort
|
||||
.public DoMoveLeechSeed
|
||||
.public DoMoveLowerAccuracy1
|
||||
.public DoMoveLowerDefense1
|
||||
.public DoMoveLowerSpeed1
|
||||
.public DoMoveMagnitude
|
||||
.public DoMoveMetalSound
|
||||
.public DoMoveMiracleEye
|
||||
.public DoMoveMistBall
|
||||
.public DoMoveMudSlap
|
||||
.public DoMoveNaturalGift
|
||||
.public DoMoveNightmare
|
||||
.public DoMoveOhko
|
||||
.public DoMovePainSplit
|
||||
.public DoMoveParalyze__02326E80
|
||||
.public DoMoveParalyze__0232B434
|
||||
.public DoMovePause
|
||||
.public DoMovePayDay
|
||||
.public DoMovePoison
|
||||
.public DoMovePoisonFang
|
||||
.public DoMovePoisonTail
|
||||
.public DoMovePowerSwap
|
||||
.public DoMovePresent
|
||||
.public DoMovePsychoShift
|
||||
.public DoMoveRapidSpin
|
||||
.public DoMoveReturn
|
||||
.public DoMoveReversal
|
||||
.public DoMoveRolePlay
|
||||
.public DoMoveSacredFire
|
||||
.public DoMoveSecretPower
|
||||
.public DoMoveSeismicToss
|
||||
.public DoMoveSkillSwap
|
||||
.public DoMoveSmellingSalt
|
||||
.public DoMoveSmokescreen
|
||||
.public DoMoveSpite
|
||||
.public DoMoveSuperFang
|
||||
.public DoMoveSuperpower
|
||||
.public DoMoveSwagger
|
||||
.public DoMoveSwapItems
|
||||
.public DoMoveTaunt
|
||||
.public DoMoveThunderFang
|
||||
.public DoMoveThunderWave
|
||||
.public DoMoveThundershock
|
||||
.public DoMoveTickle
|
||||
.public DoMoveTorment
|
||||
.public DoMoveToxic
|
||||
.public DoMoveTriAttack
|
||||
.public DoMoveTripleKick
|
||||
.public DoMoveTrumpCard
|
||||
.public DoMoveTwineedle
|
||||
.public DoMoveTwister
|
||||
.public DoMoveWakeUpSlap
|
||||
.public DoMoveWhirlpool
|
||||
.public DoMoveWillOWisp
|
||||
.public DoMoveWrap
|
||||
.public DoMoveYawn
|
||||
|
|
@ -1,136 +1 @@
|
|||
#pragma once
|
||||
.public DoMoveAbsorb
|
||||
.public DoMoveAttract
|
||||
.public DoMoveBeatUp
|
||||
.public DoMoveBlastBurn
|
||||
.public DoMoveBlazeKick
|
||||
.public DoMoveBlock
|
||||
.public DoMoveBlowback
|
||||
.public DoMoveBrickBreak
|
||||
.public DoMoveBrine
|
||||
.public DoMoveCaptivate
|
||||
.public DoMoveChargeBeam
|
||||
.public DoMoveCharm
|
||||
.public DoMoveCloseCombat
|
||||
.public DoMoveConfuse
|
||||
.public DoMoveCopycat
|
||||
.public DoMoveCrunch
|
||||
.public DoMoveCrushClaw
|
||||
.public DoMoveCurse
|
||||
.public DoMoveDamage__02325DC0
|
||||
.public DoMoveDamage__0232A500
|
||||
.public DoMoveDamage__0232B8B0
|
||||
.public DoMoveDamage__0232DD88
|
||||
.public DoMoveDamageBoostAllStats
|
||||
.public DoMoveDamageBurn10FlameWheel
|
||||
.public DoMoveDamageConfuse10
|
||||
.public DoMoveDamageConfuse30
|
||||
.public DoMoveDamageConstrict10
|
||||
.public DoMoveDamageCringe10
|
||||
.public DoMoveDamageCringe20
|
||||
.public DoMoveDamageCringe30
|
||||
.public DoMoveDamageDrain
|
||||
.public DoMoveDamageEatItem
|
||||
.public DoMoveDamageHpDependent
|
||||
.public DoMoveDamageLowerAccuracy40
|
||||
.public DoMoveDamageLowerSpecialDefense50
|
||||
.public DoMoveDamageLowerSpeed100
|
||||
.public DoMoveDamageLowerSpeed20
|
||||
.public DoMoveDamageMultihitFatigue
|
||||
.public DoMoveDamageParalyze10
|
||||
.public DoMoveDamageParalyze20
|
||||
.public DoMoveDamagePoison18
|
||||
.public DoMoveDamagePoison40
|
||||
.public DoMoveDamageStealItem
|
||||
.public DoMoveDamageWeightDependent
|
||||
.public DoMoveDamageWithRecoil
|
||||
.public DoMoveDefog
|
||||
.public DoMoveDestinyBond
|
||||
.public DoMoveDoubleEdge
|
||||
.public DoMoveDragonRage
|
||||
.public DoMoveDreamEater
|
||||
.public DoMoveDynamicPunch
|
||||
.public DoMoveEmbargo
|
||||
.public DoMoveEncore
|
||||
.public DoMoveEndeavor
|
||||
.public DoMoveEruption
|
||||
.public DoMoveFacade
|
||||
.public DoMoveFakeOut
|
||||
.public DoMoveFakeTears
|
||||
.public DoMoveFeatherDance
|
||||
.public DoMoveFeint
|
||||
.public DoMoveFireFang
|
||||
.public DoMoveFissure
|
||||
.public DoMoveFlareBlitz
|
||||
.public DoMoveFlatter
|
||||
.public DoMoveFrustration
|
||||
.public DoMoveGastroAcid
|
||||
.public DoMoveGuardSwap
|
||||
.public DoMoveGust
|
||||
.public DoMoveGyroBall
|
||||
.public DoMoveHammerArm
|
||||
.public DoMoveHeadbutt
|
||||
.public DoMoveHeadSmash
|
||||
.public DoMoveHeartSwap
|
||||
.public DoMoveHiddenPower
|
||||
.public DoMoveHornDrill
|
||||
.public DoMoveHurl
|
||||
.public DoMoveIceFang
|
||||
.public DoMoveIronTail
|
||||
.public DoMoveKnockOff
|
||||
.public DoMoveLastResort
|
||||
.public DoMoveLeechSeed
|
||||
.public DoMoveLowerAccuracy1
|
||||
.public DoMoveLowerDefense1
|
||||
.public DoMoveLowerSpeed1
|
||||
.public DoMoveMagnitude
|
||||
.public DoMoveMetalSound
|
||||
.public DoMoveMiracleEye
|
||||
.public DoMoveMistBall
|
||||
.public DoMoveMudSlap
|
||||
.public DoMoveNaturalGift
|
||||
.public DoMoveNightmare
|
||||
.public DoMoveOhko
|
||||
.public DoMovePainSplit
|
||||
.public DoMoveParalyze__02326E80
|
||||
.public DoMoveParalyze__0232B434
|
||||
.public DoMovePause
|
||||
.public DoMovePayDay
|
||||
.public DoMovePoison
|
||||
.public DoMovePoisonFang
|
||||
.public DoMovePoisonTail
|
||||
.public DoMovePowerSwap
|
||||
.public DoMovePresent
|
||||
.public DoMovePsychoShift
|
||||
.public DoMoveRapidSpin
|
||||
.public DoMoveReturn
|
||||
.public DoMoveReversal
|
||||
.public DoMoveRolePlay
|
||||
.public DoMoveSacredFire
|
||||
.public DoMoveSecretPower
|
||||
.public DoMoveSeismicToss
|
||||
.public DoMoveSkillSwap
|
||||
.public DoMoveSmellingSalt
|
||||
.public DoMoveSmokescreen
|
||||
.public DoMoveSpite
|
||||
.public DoMoveSuperFang
|
||||
.public DoMoveSuperpower
|
||||
.public DoMoveSwagger
|
||||
.public DoMoveSwapItems
|
||||
.public DoMoveTaunt
|
||||
.public DoMoveThunderFang
|
||||
.public DoMoveThundershock
|
||||
.public DoMoveThunderWave
|
||||
.public DoMoveTickle
|
||||
.public DoMoveTorment
|
||||
.public DoMoveToxic
|
||||
.public DoMoveTriAttack
|
||||
.public DoMoveTripleKick
|
||||
.public DoMoveTrumpCard
|
||||
.public DoMoveTwineedle
|
||||
.public DoMoveTwister
|
||||
.public DoMoveWakeUpSlap
|
||||
.public DoMoveWhirlpool
|
||||
.public DoMoveWillOWisp
|
||||
.public DoMoveWrap
|
||||
.public DoMoveYawn
|
||||
|
|
|
|||
|
|
@ -5,17 +5,9 @@
|
|||
.public GetItemCategoryVeneer
|
||||
.public GetItemInfo
|
||||
.public GetTile
|
||||
.public IsHM
|
||||
.public ITEM_CATEGORY_ACTIONS
|
||||
.public IsHM
|
||||
.public ItemZInit
|
||||
.public ov29_02347040
|
||||
.public ov29_02352074
|
||||
.public ov29_0237C918
|
||||
.public ov29_0237C91C
|
||||
.public ov29_0237C91E
|
||||
.public ov29_0237C920
|
||||
.public ov29_0237C922
|
||||
.public ov29_0237C96C
|
||||
.public RemoveEmptyItemsInBagWrapper
|
||||
.public RemoveEquivItemNoHole
|
||||
.public RemoveGroundItem
|
||||
|
|
@ -24,3 +16,11 @@
|
|||
.public SetMonsterActionFields
|
||||
.public ShouldDisplayEntityWrapper
|
||||
.public SpawnItem
|
||||
.public ov29_02347040
|
||||
.public ov29_02352074
|
||||
.public ov29_0237C918
|
||||
.public ov29_0237C91C
|
||||
.public ov29_0237C91E
|
||||
.public ov29_0237C920
|
||||
.public ov29_0237C922
|
||||
.public ov29_0237C96C
|
||||
|
|
|
|||
2
asm/include/overlay_29_022EBC98.inc
Normal file
2
asm/include/overlay_29_022EBC98.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
.public SetMonsterActionFields
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
.public AbilityIsActive
|
||||
.public DefenderAbilityIsActive__02301A0C
|
||||
.public DUNGEON_PTR
|
||||
.public DefenderAbilityIsActive__02301A0C
|
||||
.public EntityIsValid__023000E4
|
||||
.public GravityIsActive
|
||||
.public ov29_022FAFD4
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
#pragma once
|
||||
.public AFTERMATH_CHANCE
|
||||
.public AbilityIsActiveVeneer
|
||||
.public DUNGEON_PTR
|
||||
.public DefenderAbilityIsActive__0230A940
|
||||
.public DungeonRandOutcome__022EAB20
|
||||
.public ExclusiveItemEffectIsActive__0230A9B8
|
||||
.public GetTypeMatchup
|
||||
.public GhostImmunityIsActive
|
||||
.public IsTypeIneffectiveAgainstGhost
|
||||
.public ScrappyShouldActivate
|
||||
.public TYPE_MATCHUP_COMBINATOR_TABLE
|
||||
.public TryAftermathExplosion
|
||||
.public ov29_02352838
|
||||
|
|
|
|||
2
asm/include/overlay_29_0230ABF0.inc
Normal file
2
asm/include/overlay_29_0230ABF0.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
.public ExclusiveItemEffectIsActive__0230A9B8
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#pragma once
|
||||
.public DIRECTIONS_XY
|
||||
.public EntityIsValid__0230F008
|
||||
.public GetTile
|
||||
.public IsMonster__0230F980
|
||||
.public ItemIsActive__0230F810
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#pragma once
|
||||
.public CanAttackInDirection
|
||||
.public DIRECTIONS_XY
|
||||
.public DungeonRandInt
|
||||
.public GetTile
|
||||
.public GetTreatmentBetweenMonsters
|
||||
.public IqSkillIsEnabled
|
||||
.public IsBlinded
|
||||
.public ov29_0230F8D0
|
||||
.public WeightMoveWithIqSkills
|
||||
|
|
@ -1,58 +1,14 @@
|
|||
#pragma once
|
||||
.public AbilityIsActiveVeneer
|
||||
.public AdvanceFrame
|
||||
.public AnimationDelayOrSomething
|
||||
.public AnimationHasMoreFrames
|
||||
.public ChangeMonsterAnimation
|
||||
.public DefenderAbilityIsActive__02322D64
|
||||
.public DUNGEON_PTR
|
||||
.public DefenderAbilityIsActive__02322D64
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandOutcome__022EAB50
|
||||
.public EntityIsValid__02321438
|
||||
.public EntityIsValid__02325620
|
||||
.public GetApparentWeather
|
||||
.public GetDamageSource
|
||||
.public GetMoveAnimation
|
||||
.public GetMoveAnimationId
|
||||
.public GetMoveMaxGinsengBoost
|
||||
.public GetNaturePowerVariant
|
||||
.public GetSpriteIndex__02052708
|
||||
.public Is2TurnsMove
|
||||
.public IsCopyingMove
|
||||
.public IsFloorOver
|
||||
.public IsUsableWhileTaunted
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public NATURE_POWER_TABLE
|
||||
.public ov10_022BF01C
|
||||
.public ov10_022BF0F4
|
||||
.public ov10_022BF1FC
|
||||
.public ov10_022BFA3C
|
||||
.public ov10_022BFAA8
|
||||
.public ov10_022BFD58
|
||||
.public ov10_022BFD8C
|
||||
.public ov10_022BFDCC
|
||||
.public ov10_022BFDEC
|
||||
.public ov29_022DE5D8
|
||||
.public ov29_022DE5F0
|
||||
.public ov29_022E3560
|
||||
.public ov29_022E56A0
|
||||
.public ov29_022E65A8
|
||||
.public ov29_022E6D68
|
||||
.public ov29_022EA370
|
||||
.public ov29_022EACCC
|
||||
.public ov29_022ED0C4
|
||||
.public ov29_022ED0D4
|
||||
.public ov29_02304A48
|
||||
.public ov29_02325644
|
||||
.public ov29_02325D20
|
||||
.public ov29_02325D7C
|
||||
.public ov29_02352AD8
|
||||
.public ov29_02352B1C
|
||||
.public ov29_0237CA84
|
||||
.public SetAndLoadCurrentAttackAnimation
|
||||
.public SetMessageLogPreprocessorArgsNumberVal
|
||||
.public ShouldDisplayEntityAdvanced
|
||||
.public ShouldMovePlayAlternativeAnimation
|
||||
.public sub_0201CF90
|
||||
.public sub_0201D1D4
|
||||
.public WanTableSpriteHasAnimationGroup
|
||||
.public ov29_02324D60
|
||||
|
|
|
|||
49
asm/include/overlay_29_02324BE8.inc
Normal file
49
asm/include/overlay_29_02324BE8.inc
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
.public AdvanceFrame
|
||||
.public AnimationDelayOrSomething
|
||||
.public AnimationHasMoreFrames
|
||||
.public ChangeMonsterAnimation
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonRandInt
|
||||
.public EntityIsValid__02321438
|
||||
.public EntityIsValid__02325620
|
||||
.public GetApparentWeather
|
||||
.public GetDamageSource
|
||||
.public GetMoveAnimation
|
||||
.public GetMoveAnimationId
|
||||
.public GetSpriteIndex__02052708
|
||||
.public Is2TurnsMove
|
||||
.public IsUsableWhileTaunted
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public SetAndLoadCurrentAttackAnimation
|
||||
.public SetMessageLogPreprocessorArgsNumberVal
|
||||
.public ShouldDisplayEntityAdvanced
|
||||
.public ShouldMovePlayAlternativeAnimation
|
||||
.public WanTableSpriteHasAnimationGroup
|
||||
.public ov10_022BF01C
|
||||
.public ov10_022BF0F4
|
||||
.public ov10_022BF1FC
|
||||
.public ov10_022BFA3C
|
||||
.public ov10_022BFAA8
|
||||
.public ov10_022BFD58
|
||||
.public ov10_022BFD8C
|
||||
.public ov10_022BFDCC
|
||||
.public ov10_022BFDEC
|
||||
.public ov29_022DE5D8
|
||||
.public ov29_022DE5F0
|
||||
.public ov29_022E3560
|
||||
.public ov29_022E56A0
|
||||
.public ov29_022E6D68
|
||||
.public ov29_022EA370
|
||||
.public ov29_022EACCC
|
||||
.public ov29_022ED0C4
|
||||
.public ov29_022ED0D4
|
||||
.public ov29_02304A48
|
||||
.public ov29_02325644
|
||||
.public ov29_02325D20
|
||||
.public ov29_02325D7C
|
||||
.public ov29_02352AD8
|
||||
.public ov29_02352B1C
|
||||
.public ov29_0237CA84
|
||||
.public sub_0201CF90
|
||||
.public sub_0201D1D4
|
||||
|
|
@ -9,6 +9,5 @@
|
|||
.public IqSkillIsEnabled
|
||||
.public MemAlloc
|
||||
.public MemFree
|
||||
.public MemZero
|
||||
.public ov29_022FAFD4
|
||||
.public RandInt
|
||||
.public ov29_022FAFD4
|
||||
|
|
|
|||
3
asm/include/overlay_29_0233836C.inc
Normal file
3
asm/include/overlay_29_0233836C.inc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
.public DUNGEON_PTR
|
||||
.public MemZero
|
||||
|
|
@ -90,55 +90,3 @@ GetMovesetEggPtr: ; 0x02013940
|
|||
_02013984: .word _02098D64
|
||||
_02013988: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMovesetEggPtr
|
||||
|
||||
arm_func_start GetMoveAiWeight
|
||||
GetMoveAiWeight: ; 0x0201398C
|
||||
ldr r1, _020139A8 ; =DUNGEON_MOVE_TABLES
|
||||
ldrh r2, [r0, #4]
|
||||
ldr r1, [r1, #8]
|
||||
mov r0, #0x1a
|
||||
mla r0, r2, r0, r1
|
||||
ldrb r0, [r0, #9]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020139A8: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveAiWeight
|
||||
|
||||
arm_func_start GetMoveNbStrikes
|
||||
GetMoveNbStrikes: ; 0x020139AC
|
||||
ldr r1, _020139C8 ; =DUNGEON_MOVE_TABLES
|
||||
ldrh r2, [r0, #4]
|
||||
ldr r1, [r1, #8]
|
||||
mov r0, #0x1a
|
||||
mla r0, r2, r0, r1
|
||||
ldrb r0, [r0, #0xd]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020139C8: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveNbStrikes
|
||||
|
||||
arm_func_start GetMoveBasePower
|
||||
GetMoveBasePower: ; 0x020139CC
|
||||
ldrh r2, [r0, #4]
|
||||
mov r0, #0x1a
|
||||
ldr r1, _020139E8 ; =DUNGEON_MOVE_TABLES
|
||||
mul r0, r2, r0
|
||||
ldr r1, [r1, #8]
|
||||
ldrsh r0, [r1, r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020139E8: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveBasePower
|
||||
|
||||
arm_func_start GetMoveBasePowerGround
|
||||
GetMoveBasePowerGround: ; 0x020139EC
|
||||
ldrh r2, [r0, #2]
|
||||
mov r0, #0x1a
|
||||
ldr r1, _02013A08 ; =DUNGEON_MOVE_TABLES
|
||||
mul r0, r2, r0
|
||||
ldr r1, [r1, #8]
|
||||
ldrsh r0, [r1, r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02013A08: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveBasePowerGround
|
||||
|
|
|
|||
43
asm/main_020139AC.s
Normal file
43
asm/main_020139AC.s
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "main_020139AC.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start GetMoveNbStrikes
|
||||
GetMoveNbStrikes: ; 0x020139AC
|
||||
ldr r1, _020139C8 ; =DUNGEON_MOVE_TABLES
|
||||
ldrh r2, [r0, #4]
|
||||
ldr r1, [r1, #8]
|
||||
mov r0, #0x1a
|
||||
mla r0, r2, r0, r1
|
||||
ldrb r0, [r0, #0xd]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020139C8: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveNbStrikes
|
||||
|
||||
arm_func_start GetMoveBasePower
|
||||
GetMoveBasePower: ; 0x020139CC
|
||||
ldrh r2, [r0, #4]
|
||||
mov r0, #0x1a
|
||||
ldr r1, _020139E8 ; =DUNGEON_MOVE_TABLES
|
||||
mul r0, r2, r0
|
||||
ldr r1, [r1, #8]
|
||||
ldrsh r0, [r1, r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_020139E8: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveBasePower
|
||||
|
||||
arm_func_start GetMoveBasePowerGround
|
||||
GetMoveBasePowerGround: ; 0x020139EC
|
||||
ldrh r2, [r0, #2]
|
||||
mov r0, #0x1a
|
||||
ldr r1, _02013A08 ; =DUNGEON_MOVE_TABLES
|
||||
mul r0, r2, r0
|
||||
ldr r1, [r1, #8]
|
||||
ldrsh r0, [r1, r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02013A08: .word DUNGEON_MOVE_TABLES
|
||||
arm_func_end GetMoveBasePowerGround
|
||||
6261
asm/overlay_10_022C5938.s
Normal file
6261
asm/overlay_10_022C5938.s
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -693,42 +693,3 @@ ov29_022EBC2C: ; 0x022EBC2C
|
|||
strb r4, [r6, #0xa]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
arm_func_end ov29_022EBC2C
|
||||
|
||||
arm_func_start SetActionRegularAttack
|
||||
SetActionRegularAttack: ; 0x022EBC50
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r4, r1
|
||||
mov r1, #0x32
|
||||
mov r5, r0
|
||||
bl SetMonsterActionFields
|
||||
cmp r4, #0xff
|
||||
andne r0, r4, #7
|
||||
strneb r0, [r5, #2]
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end SetActionRegularAttack
|
||||
|
||||
arm_func_start SetActionStruggle
|
||||
SetActionStruggle: ; 0x022EBC74
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r4, r1
|
||||
mov r1, #0x17
|
||||
mov r5, r0
|
||||
bl SetMonsterActionFields
|
||||
cmp r4, #0xff
|
||||
andne r0, r4, #7
|
||||
strneb r0, [r5, #2]
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end SetActionStruggle
|
||||
|
||||
arm_func_start SetActionUseMovePlayer
|
||||
SetActionUseMovePlayer: ; 0x022EBC98
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r5, r1
|
||||
mov r1, #0x14
|
||||
mov r6, r0
|
||||
mov r4, r2
|
||||
bl SetMonsterActionFields
|
||||
strb r5, [r6, #4]
|
||||
strb r4, [r6, #0xa]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
arm_func_end SetActionUseMovePlayer
|
||||
|
|
|
|||
17
asm/overlay_29_022EBC98.s
Normal file
17
asm/overlay_29_022EBC98.s
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_022EBC98.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start SetActionUseMovePlayer
|
||||
SetActionUseMovePlayer: ; 0x022EBC98
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r5, r1
|
||||
mov r1, #0x14
|
||||
mov r6, r0
|
||||
mov r4, r2
|
||||
bl SetMonsterActionFields
|
||||
strb r5, [r6, #4]
|
||||
strb r4, [r6, #0xa]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
arm_func_end SetActionUseMovePlayer
|
||||
|
|
@ -87,21 +87,3 @@ _02301E04:
|
|||
.align 2, 0
|
||||
_02301E14: .word DUNGEON_PTR
|
||||
arm_func_end OtherMonsterAbilityIsActive
|
||||
|
||||
arm_func_start LevitateIsActive
|
||||
LevitateIsActive: ; 0x02301E18
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
bl GravityIsActive
|
||||
cmp r0, #0
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r4, pc}
|
||||
mov r0, r4
|
||||
mov r1, #0x37
|
||||
bl AbilityIsActive
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
and r0, r0, #0xff
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end LevitateIsActive
|
||||
|
|
|
|||
|
|
@ -102,88 +102,3 @@ _0230AB4C: .word ov29_02352838
|
|||
_0230AB50: .word DUNGEON_PTR
|
||||
_0230AB54: .word TYPE_MATCHUP_COMBINATOR_TABLE
|
||||
arm_func_end GetTypeMatchupBothTypes
|
||||
|
||||
arm_func_start ScrappyShouldActivate
|
||||
ScrappyShouldActivate: ; 0x0230AB58
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
mov r6, #0
|
||||
mov sl, r0
|
||||
mov sb, r1
|
||||
mov r8, r2
|
||||
mov r5, #0x57
|
||||
mov fp, r6
|
||||
mov r4, #1
|
||||
b _0230ABDC
|
||||
_0230AB7C:
|
||||
mov r0, sl
|
||||
mov r1, r5
|
||||
ldr r7, [sb, #0xb4]
|
||||
bl AbilityIsActiveVeneer
|
||||
cmp r0, #0
|
||||
beq _0230ABB4
|
||||
add r0, r7, r6
|
||||
ldrb r0, [r0, #0x5e]
|
||||
cmp r0, #0xe
|
||||
bne _0230ABB4
|
||||
cmp r8, #1
|
||||
cmpne r8, #7
|
||||
moveq r0, r4
|
||||
beq _0230ABB8
|
||||
_0230ABB4:
|
||||
mov r0, fp
|
||||
_0230ABB8:
|
||||
cmp r0, #0
|
||||
ldrne r1, _0230ABEC ; =DUNGEON_PTR
|
||||
movne r0, #1
|
||||
ldrne r1, [r1]
|
||||
strneb r0, [r1, #0x1cc]
|
||||
ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
add r0, r6, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r6, r0, asr #0x10
|
||||
_0230ABDC:
|
||||
cmp r6, #2
|
||||
blt _0230AB7C
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_0230ABEC: .word DUNGEON_PTR
|
||||
arm_func_end ScrappyShouldActivate
|
||||
|
||||
arm_func_start IsTypeIneffectiveAgainstGhost
|
||||
IsTypeIneffectiveAgainstGhost: ; 0x0230ABF0
|
||||
cmp r0, #1
|
||||
cmpne r0, #7
|
||||
moveq r0, #1
|
||||
movne r0, #0
|
||||
bx lr
|
||||
arm_func_end IsTypeIneffectiveAgainstGhost
|
||||
|
||||
arm_func_start GhostImmunityIsActive
|
||||
GhostImmunityIsActive: ; 0x0230AC04
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r3, [r1, #0xb4]
|
||||
add r1, r3, r2
|
||||
ldrb r1, [r1, #0x5e]
|
||||
cmp r1, #0xe
|
||||
bne _0230AC50
|
||||
ldrb r1, [r3, #0xfe]
|
||||
cmp r1, #0
|
||||
bne _0230AC38
|
||||
mov r1, #0x45
|
||||
bl ExclusiveItemEffectIsActive__0230A9B8
|
||||
cmp r0, #0
|
||||
beq _0230AC40
|
||||
_0230AC38:
|
||||
mov r0, #1
|
||||
b _0230AC44
|
||||
_0230AC40:
|
||||
mov r0, #0
|
||||
_0230AC44:
|
||||
cmp r0, #0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, pc}
|
||||
_0230AC50:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end GhostImmunityIsActive
|
||||
|
|
|
|||
42
asm/overlay_29_0230ABF0.s
Normal file
42
asm/overlay_29_0230ABF0.s
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0230ABF0.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start IsTypeIneffectiveAgainstGhost
|
||||
IsTypeIneffectiveAgainstGhost: ; 0x0230ABF0
|
||||
cmp r0, #1
|
||||
cmpne r0, #7
|
||||
moveq r0, #1
|
||||
movne r0, #0
|
||||
bx lr
|
||||
arm_func_end IsTypeIneffectiveAgainstGhost
|
||||
|
||||
arm_func_start GhostImmunityIsActive
|
||||
GhostImmunityIsActive: ; 0x0230AC04
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r3, [r1, #0xb4]
|
||||
add r1, r3, r2
|
||||
ldrb r1, [r1, #0x5e]
|
||||
cmp r1, #0xe
|
||||
bne _0230AC50
|
||||
ldrb r1, [r3, #0xfe]
|
||||
cmp r1, #0
|
||||
bne _0230AC38
|
||||
mov r1, #0x45
|
||||
bl ExclusiveItemEffectIsActive__0230A9B8
|
||||
cmp r0, #0
|
||||
beq _0230AC40
|
||||
_0230AC38:
|
||||
mov r0, #1
|
||||
b _0230AC44
|
||||
_0230AC40:
|
||||
mov r0, #0
|
||||
_0230AC44:
|
||||
cmp r0, #0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, pc}
|
||||
_0230AC50:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end GhostImmunityIsActive
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0230F8D0.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ov29_0230F8D0
|
||||
ov29_0230F8D0: ; 0x0230F8D0
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, lr}
|
||||
mov r8, r0
|
||||
mov r7, r1
|
||||
bl EntityIsValid__0230F008
|
||||
cmp r0, #0
|
||||
moveq r0, #0xff
|
||||
ldmeqia sp!, {r3, r4, r5, r6, r7, r8, sb, pc}
|
||||
ldr r0, [r8, #0xb4]
|
||||
mov r5, #0
|
||||
ldrb r6, [r0, #0x4c]
|
||||
ldr r4, _0230F97C ; =DIRECTIONS_XY
|
||||
b _0230F96C
|
||||
_0230F900:
|
||||
mov r1, r6, lsl #2
|
||||
add r0, r4, r6, lsl #2
|
||||
ldrsh ip, [r8, #4]
|
||||
ldrsh r3, [r4, r1]
|
||||
ldrsh r2, [r8, #6]
|
||||
ldrsh r1, [r0, #2]
|
||||
add r0, ip, r3
|
||||
add r1, r2, r1
|
||||
bl GetTile
|
||||
ldr sb, [r0, #0xc]
|
||||
cmp sb, #0
|
||||
beq _0230F958
|
||||
mov r0, sb
|
||||
bl IsMonster__0230F980
|
||||
cmp r0, #0
|
||||
beq _0230F958
|
||||
mov r0, sb
|
||||
mov r1, r7
|
||||
bl ItemIsActive__0230F810
|
||||
cmp r0, #0
|
||||
movne r0, r6
|
||||
ldmneia sp!, {r3, r4, r5, r6, r7, r8, sb, pc}
|
||||
_0230F958:
|
||||
add r0, r6, #1
|
||||
and r0, r0, #0xff
|
||||
add r1, r5, #1
|
||||
and r6, r0, #7
|
||||
and r5, r1, #0xff
|
||||
_0230F96C:
|
||||
cmp r5, #8
|
||||
blo _0230F900
|
||||
mov r0, #0xff
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, pc}
|
||||
.align 2, 0
|
||||
_0230F97C: .word DIRECTIONS_XY
|
||||
arm_func_end ov29_0230F8D0
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0231A460.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start TargetRegularAttack
|
||||
TargetRegularAttack: ; 0x0231A460
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x48
|
||||
mov sl, r0
|
||||
ldr r3, [sl, #0xb4]
|
||||
mov sb, r1
|
||||
str r2, [sp]
|
||||
mov r1, #1
|
||||
ldrb r6, [r3, #0x4c]
|
||||
mov r4, #0
|
||||
bl IsBlinded
|
||||
cmp r0, #0
|
||||
movne r7, #1
|
||||
bne _0231A4AC
|
||||
mov r0, sl
|
||||
mov r1, #0xf
|
||||
bl ov29_0230F8D0
|
||||
cmp r0, #0xff
|
||||
mov r7, #8
|
||||
movne r6, r0
|
||||
_0231A4AC:
|
||||
mov r0, sl
|
||||
mov r1, #9
|
||||
bl IqSkillIsEnabled
|
||||
cmp r0, #0
|
||||
bne _0231A4D4
|
||||
mov r0, sl
|
||||
mov r1, #0xa
|
||||
bl IqSkillIsEnabled
|
||||
cmp r0, #0
|
||||
beq _0231A4DC
|
||||
_0231A4D4:
|
||||
mov r2, #1
|
||||
b _0231A4E0
|
||||
_0231A4DC:
|
||||
mov r2, #0
|
||||
_0231A4E0:
|
||||
mov r0, sl
|
||||
mov r1, #8
|
||||
and fp, r2, #0xff
|
||||
bl IqSkillIsEnabled
|
||||
str r0, [sp, #4]
|
||||
mov r5, #0
|
||||
b _0231A5CC
|
||||
_0231A4FC:
|
||||
and r6, r6, #7
|
||||
ldr r1, _0231A690 ; =DIRECTIONS_XY
|
||||
mov r2, r6, lsl #2
|
||||
ldrsh r3, [r1, r2]
|
||||
add r1, r1, r6, lsl #2
|
||||
ldrsh r0, [sl, #4]
|
||||
ldrsh r2, [sl, #6]
|
||||
ldrsh r1, [r1, #2]
|
||||
add r0, r0, r3
|
||||
add r1, r2, r1
|
||||
bl GetTile
|
||||
ldr r8, [r0, #0xc]
|
||||
cmp r8, #0
|
||||
beq _0231A5C4
|
||||
ldr r0, [r8]
|
||||
cmp r0, #1
|
||||
bne _0231A5C4
|
||||
mov r0, sl
|
||||
mov r1, r6
|
||||
bl CanAttackInDirection
|
||||
cmp r0, #0
|
||||
beq _0231A5C4
|
||||
ldr r3, [sp]
|
||||
mov r0, sl
|
||||
mov r1, r8
|
||||
mov r2, #0
|
||||
bl GetTreatmentBetweenMonsters
|
||||
cmp r0, #1
|
||||
bne _0231A5C4
|
||||
ldr r0, [sp, #4]
|
||||
cmp r0, #0
|
||||
beq _0231A58C
|
||||
ldr r0, [r8, #0xb4]
|
||||
ldrb r0, [r0, #0xc4]
|
||||
cmp r0, #1
|
||||
beq _0231A5C4
|
||||
_0231A58C:
|
||||
add r0, sp, #0x28
|
||||
mov r1, #0
|
||||
str r6, [r0, r4, lsl #2]
|
||||
mov r2, r8
|
||||
mov r0, sl
|
||||
mov r3, r1
|
||||
bl WeightMoveWithIqSkills
|
||||
add r1, sp, #8
|
||||
cmp fp, #0
|
||||
str r0, [r1, r4, lsl #2]
|
||||
streq r6, [sb]
|
||||
moveq r0, #1
|
||||
beq _0231A688
|
||||
add r4, r4, #1
|
||||
_0231A5C4:
|
||||
add r5, r5, #1
|
||||
add r6, r6, #1
|
||||
_0231A5CC:
|
||||
cmp r5, r7
|
||||
blt _0231A4FC
|
||||
cmp r4, #0
|
||||
mov r0, #0
|
||||
beq _0231A688
|
||||
mov r5, r0
|
||||
mov r3, r0
|
||||
add r2, sp, #8
|
||||
b _0231A600
|
||||
_0231A5F0:
|
||||
ldr r1, [r2, r3, lsl #2]
|
||||
add r3, r3, #1
|
||||
cmp r5, r1
|
||||
movlt r5, r1
|
||||
_0231A600:
|
||||
cmp r3, r4
|
||||
blt _0231A5F0
|
||||
mov r6, #0
|
||||
mov r1, r6
|
||||
add r3, sp, #8
|
||||
b _0231A628
|
||||
_0231A618:
|
||||
ldr r2, [r3, r6, lsl #2]
|
||||
cmp r5, r2
|
||||
strne r1, [r3, r6, lsl #2]
|
||||
add r6, r6, #1
|
||||
_0231A628:
|
||||
cmp r6, r4
|
||||
blt _0231A618
|
||||
mov r3, #0
|
||||
add r2, sp, #8
|
||||
b _0231A648
|
||||
_0231A63C:
|
||||
ldr r1, [r2, r3, lsl #2]
|
||||
add r3, r3, #1
|
||||
add r0, r0, r1
|
||||
_0231A648:
|
||||
cmp r3, r4
|
||||
blt _0231A63C
|
||||
bl DungeonRandInt
|
||||
mov r3, #0
|
||||
add r2, sp, #8
|
||||
b _0231A670
|
||||
_0231A660:
|
||||
ldr r1, [r2, r3, lsl #2]
|
||||
subs r0, r0, r1
|
||||
bmi _0231A678
|
||||
add r3, r3, #1
|
||||
_0231A670:
|
||||
cmp r3, r4
|
||||
blt _0231A660
|
||||
_0231A678:
|
||||
add r1, sp, #0x28
|
||||
ldr r1, [r1, r3, lsl #2]
|
||||
mov r0, #1
|
||||
str r1, [sb]
|
||||
_0231A688:
|
||||
add sp, sp, #0x48
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_0231A690: .word DIRECTIONS_XY
|
||||
arm_func_end TargetRegularAttack
|
||||
|
|
@ -320,879 +320,3 @@ _02324A68:
|
|||
bl DungeonRandOutcome__022EAB50
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end DungeonRandOutcomeUserAction
|
||||
|
||||
arm_func_start CanAiUseMove
|
||||
CanAiUseMove: ; 0x02324A74
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, lr}
|
||||
mov r6, r0
|
||||
ldr r3, [r6, #0xb4]
|
||||
mov r5, r2
|
||||
#ifdef JAPAN
|
||||
add r0, r3, #0x120
|
||||
#else
|
||||
add r0, r3, #0x124
|
||||
#endif
|
||||
ldrb r2, [r0, r1, lsl #3]
|
||||
add r4, r0, r1, lsl #3
|
||||
tst r2, #1
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
tst r0, #0xff
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
tst r2, #2
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
tst r2, #0x20
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
ldrh r0, [r4, #2]
|
||||
tst r0, #1
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
mov r8, #0
|
||||
#ifdef JAPAN
|
||||
add r7, r3, #0x140
|
||||
#else
|
||||
add r7, r3, #0x144
|
||||
#endif
|
||||
b _02324B14
|
||||
_02324ADC:
|
||||
mov r0, r6
|
||||
mov r1, r4
|
||||
mov r2, r5
|
||||
bl CanMonsterUseMove
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
ldmneia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
add r4, r4, #8
|
||||
cmp r4, r7
|
||||
bhs _02324B1C
|
||||
ldrb r0, [r4]
|
||||
tst r0, #2
|
||||
beq _02324B1C
|
||||
add r8, r8, #1
|
||||
_02324B14:
|
||||
cmp r8, #4
|
||||
blt _02324ADC
|
||||
_02324B1C:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, pc}
|
||||
arm_func_end CanAiUseMove
|
||||
|
||||
arm_func_start CanMonsterUseMove
|
||||
CanMonsterUseMove: ; 0x02324B24
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r1
|
||||
ldrh r3, [r5, #4]
|
||||
ldr r1, _02324BE4 ; =0x00000163
|
||||
ldr r4, [r0, #0xb4]
|
||||
cmp r3, r1
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x20
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
ldrh r0, [r5, #2]
|
||||
tst r0, #1
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
cmp r2, #0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r5, #6]
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #5
|
||||
bne _02324BA0
|
||||
mov r0, r5
|
||||
bl IsUsableWhileTaunted
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324BA0:
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #6
|
||||
bne _02324BDC
|
||||
ldrh r0, [r5, #4]
|
||||
cmp r0, #0x160
|
||||
bne _02324BCC
|
||||
#ifdef JAPAN
|
||||
ldrb r0, [r4, #0x140]
|
||||
#else
|
||||
ldrb r0, [r4, #0x144]
|
||||
#endif
|
||||
tst r0, #0x10
|
||||
bne _02324BDC
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
_02324BCC:
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x10
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324BDC:
|
||||
mov r0, #1
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
.align 2, 0
|
||||
_02324BE4: .word 0x00000163
|
||||
arm_func_end CanMonsterUseMove
|
||||
|
||||
arm_func_start ov29_02324BE8
|
||||
ov29_02324BE8: ; 0x02324BE8
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r1
|
||||
ldrh r3, [r5, #4]
|
||||
ldr r1, _02324C98 ; =0x00000163
|
||||
ldr r4, [r0, #0xb4]
|
||||
cmp r3, r1
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x20
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
ldrh r0, [r5, #2]
|
||||
tst r0, #1
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
cmp r2, #0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #5
|
||||
bne _02324C54
|
||||
mov r0, r5
|
||||
bl IsUsableWhileTaunted
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324C54:
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #6
|
||||
bne _02324C90
|
||||
ldrh r0, [r5, #4]
|
||||
cmp r0, #0x160
|
||||
bne _02324C80
|
||||
#ifdef JAPAN
|
||||
ldrb r0, [r4, #0x140]
|
||||
#else
|
||||
ldrb r0, [r4, #0x144]
|
||||
#endif
|
||||
tst r0, #0x10
|
||||
bne _02324C90
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
_02324C80:
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x10
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324C90:
|
||||
mov r0, #1
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
.align 2, 0
|
||||
_02324C98: .word 0x00000163
|
||||
arm_func_end ov29_02324BE8
|
||||
|
||||
arm_func_start ov29_02324C9C
|
||||
ov29_02324C9C: ; 0x02324C9C
|
||||
stmdb sp!, {lr}
|
||||
sub sp, sp, #0x104
|
||||
mov ip, #0
|
||||
mov lr, ip
|
||||
add r2, sp, #0
|
||||
b _02324CDC
|
||||
_02324CB4:
|
||||
ldr r3, [r0, lr, lsl #2]
|
||||
cmp r3, #0
|
||||
beq _02324CE4
|
||||
cmp r3, r1
|
||||
beq _02324CD8
|
||||
cmp ip, #0x40
|
||||
bge _02324CE4
|
||||
str r3, [r2, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324CD8:
|
||||
add lr, lr, #1
|
||||
_02324CDC:
|
||||
cmp lr, #0x41
|
||||
blt _02324CB4
|
||||
_02324CE4:
|
||||
mov lr, #0
|
||||
add r2, sp, #0
|
||||
b _02324D18
|
||||
_02324CF0:
|
||||
ldr r3, [r0, lr, lsl #2]
|
||||
cmp r3, #0
|
||||
beq _02324D20
|
||||
cmp r3, r1
|
||||
bne _02324D14
|
||||
cmp ip, #0x40
|
||||
bge _02324D20
|
||||
str r3, [r2, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324D14:
|
||||
add lr, lr, #1
|
||||
_02324D18:
|
||||
cmp lr, #0x41
|
||||
blt _02324CF0
|
||||
_02324D20:
|
||||
mov r2, #0
|
||||
add r1, sp, #0
|
||||
b _02324D34
|
||||
_02324D2C:
|
||||
str r2, [r1, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324D34:
|
||||
cmp ip, #0x41
|
||||
blt _02324D2C
|
||||
mov r3, #0
|
||||
add r2, sp, #0
|
||||
_02324D44:
|
||||
ldr r1, [r2, r3, lsl #2]
|
||||
str r1, [r0, r3, lsl #2]
|
||||
add r3, r3, #1
|
||||
cmp r3, #0x41
|
||||
blt _02324D44
|
||||
add sp, sp, #0x104
|
||||
ldmia sp!, {pc}
|
||||
arm_func_end ov29_02324C9C
|
||||
|
||||
arm_func_start ov29_02324D60
|
||||
ov29_02324D60: ; 0x02324D60
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r1
|
||||
cmp r4, #0x97
|
||||
bne _02324D80
|
||||
bl GetApparentWeather
|
||||
cmp r0, #1
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r4, pc}
|
||||
_02324D80:
|
||||
mov r0, r4
|
||||
bl Is2TurnsMove
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end ov29_02324D60
|
||||
|
||||
arm_func_start UpdateMovePp
|
||||
UpdateMovePp: ; 0x02324D8C
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r0
|
||||
mov r4, r1
|
||||
bl EntityIsValid__02321438
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldr r0, [r5, #0xb4]
|
||||
mov r1, #0
|
||||
_02324DAC:
|
||||
#ifdef JAPAN
|
||||
add r2, r0, #0x120
|
||||
#else
|
||||
add r2, r0, #0x124
|
||||
#endif
|
||||
ldrb r3, [r2, r1, lsl #3]
|
||||
add r2, r2, r1, lsl #3
|
||||
tst r3, #1
|
||||
movne r3, #1
|
||||
moveq r3, #0
|
||||
tst r3, #0xff
|
||||
beq _02324E34
|
||||
ldrh r3, [r2, #2]
|
||||
mov lr, #1
|
||||
tst r3, #0x10
|
||||
bicne r3, r3, #0x10
|
||||
strneh r3, [r2, #2]
|
||||
ldrh r3, [r2, #2]
|
||||
movne lr, #2
|
||||
tst r3, #0x40
|
||||
bicne r3, r3, #0x40
|
||||
strneh r3, [r2, #2]
|
||||
ldrh r3, [r2, #2]
|
||||
movne lr, #4
|
||||
tst r3, #8
|
||||
bicne r3, r3, #8
|
||||
strneh r3, [r2, #2]
|
||||
cmpne r4, #0
|
||||
beq _02324E34
|
||||
mov ip, #0
|
||||
b _02324E2C
|
||||
_02324E18:
|
||||
ldrb r3, [r2, #6]
|
||||
add ip, ip, #1
|
||||
cmp r3, #0
|
||||
subne r3, r3, #1
|
||||
strneb r3, [r2, #6]
|
||||
_02324E2C:
|
||||
cmp ip, lr
|
||||
blt _02324E18
|
||||
_02324E34:
|
||||
add r1, r1, #1
|
||||
cmp r1, #4
|
||||
blt _02324DAC
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end UpdateMovePp
|
||||
|
||||
arm_func_start GetDamageSourceWrapper
|
||||
GetDamageSourceWrapper: ; 0x02324E44
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
mov r0, r1
|
||||
bl LowerSshort
|
||||
mov r1, r0
|
||||
ldrh r0, [r4, #4]
|
||||
bl GetDamageSource
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end GetDamageSourceWrapper
|
||||
|
||||
arm_func_start LowerSshort
|
||||
LowerSshort: ; 0x02324E64
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
movne r0, r0, lsl #0x10
|
||||
movne r0, r0, asr #0x10
|
||||
bx lr
|
||||
arm_func_end LowerSshort
|
||||
|
||||
arm_func_start ov29_02324E78
|
||||
ov29_02324E78: ; 0x02324E78
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x14
|
||||
mov r7, r0
|
||||
mov r6, r1
|
||||
mov r8, r2
|
||||
bl ShouldMovePlayAlternativeAnimation
|
||||
mov r4, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
bl ov10_022BFD58
|
||||
mov sl, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
bl GetMoveAnimation
|
||||
ldrsh r5, [r0]
|
||||
mov r0, r7
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
moveq r0, sl
|
||||
beq _023250C8
|
||||
mov r0, r7
|
||||
mov r1, r6
|
||||
bl ov29_02325D20
|
||||
cmp r0, #0
|
||||
movne r0, sl
|
||||
bne _023250C8
|
||||
cmp r8, #0
|
||||
moveq r0, sl
|
||||
beq _023250C8
|
||||
cmp r5, #0
|
||||
beq _023250C4
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
mov r4, r0
|
||||
ldrh r0, [r6, #4]
|
||||
ldr r5, [r7, #0xb4]
|
||||
bl ov10_022BFD8C
|
||||
mov sb, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, #1
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r5, #4]
|
||||
bl ov10_022BF01C
|
||||
mov r2, r0
|
||||
mvn r0, #0
|
||||
cmp r2, r0
|
||||
ldreq r0, _023250D0 ; =ov29_02352AD8
|
||||
ldreqh r1, [r0, #8]
|
||||
streqh r1, [sp, #8]
|
||||
ldreqh r0, [r0, #0xa]
|
||||
streqh r0, [sp, #0xa]
|
||||
beq _02324F98
|
||||
add r0, sp, #8
|
||||
add r1, r7, #0x2c
|
||||
and r2, r2, #0xff
|
||||
bl sub_0201CF90
|
||||
_02324F98:
|
||||
strh r4, [sp]
|
||||
ldrsh r1, [r5, #4]
|
||||
add r0, sp, #0
|
||||
mov r2, #0
|
||||
strh r1, [sp, #2]
|
||||
ldr r3, [r7, #0xc]
|
||||
mov r1, #1
|
||||
mov r3, r3, asr #8
|
||||
strh r3, [sp, #4]
|
||||
ldr r3, [r7, #0x10]
|
||||
mov r3, r3, asr #8
|
||||
strh r3, [sp, #6]
|
||||
ldrb r3, [r5, #0x4c]
|
||||
str r3, [sp, #0xc]
|
||||
str r2, [sp, #0x10]
|
||||
bl ov29_02325D7C
|
||||
mov r0, #0x58
|
||||
bl AdvanceFrame
|
||||
add r0, sp, #0
|
||||
bl ov10_022BFAA8
|
||||
mov r1, r7
|
||||
mov r2, #5
|
||||
mov r8, r0
|
||||
bl ov29_022E6D68
|
||||
mov r0, #1
|
||||
bl ov29_022DE5F0
|
||||
mov r7, r0
|
||||
cmp sb, #0
|
||||
bne _0232506C
|
||||
ldrh r0, [r6, #4]
|
||||
bl ov10_022BFDEC
|
||||
cmp r0, #0
|
||||
beq _0232506C
|
||||
mov r6, #0
|
||||
bl ov29_022ED0C4
|
||||
mov r5, r0
|
||||
mov r0, #1
|
||||
bl ov29_022E3560
|
||||
mov r4, #0xff
|
||||
mov fp, #1
|
||||
b _02325064
|
||||
_0232503C:
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r5, r0, asr #0x10
|
||||
cmp r5, #0xff
|
||||
movgt r5, r4
|
||||
mov r0, r5
|
||||
movgt r6, fp
|
||||
bl ov29_022ED0D4
|
||||
mov r0, #0x26
|
||||
bl AdvanceFrame
|
||||
_02325064:
|
||||
cmp r6, #0
|
||||
beq _0232503C
|
||||
_0232506C:
|
||||
mov r0, r8, lsl #0x10
|
||||
mov r4, r0, asr #0x10
|
||||
mov r8, #0
|
||||
mov r6, #1
|
||||
mov r5, #0x26
|
||||
b _023250B0
|
||||
_02325084:
|
||||
beq _023250A8
|
||||
cmp r7, #0x20
|
||||
subgt r7, r7, #0x20
|
||||
movle r7, r8
|
||||
mov r0, r7, lsl #0x10
|
||||
mov r1, r6
|
||||
mov r0, r0, asr #0x10
|
||||
movle sb, r8
|
||||
bl ov29_022DE5D8
|
||||
_023250A8:
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_023250B0:
|
||||
mov r0, r4
|
||||
bl AnimationHasMoreFrames
|
||||
cmp r0, #0
|
||||
cmpne sb, #0
|
||||
bne _02325084
|
||||
_023250C4:
|
||||
mov r0, sl
|
||||
_023250C8:
|
||||
add sp, sp, #0x14
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_023250D0: .word ov29_02352AD8
|
||||
arm_func_end ov29_02324E78
|
||||
|
||||
arm_func_start ov29_023250D4
|
||||
ov29_023250D4: ; 0x023250D4
|
||||
#ifdef JAPAN
|
||||
#define OV29_023250D4_OFFSET -0xA4
|
||||
#else
|
||||
#define OV29_023250D4_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x18
|
||||
mov sl, r0
|
||||
mov sb, r1
|
||||
bl ShouldMovePlayAlternativeAnimation
|
||||
mov r8, r0
|
||||
ldr r7, [sl, #0xb4]
|
||||
mov r1, #0
|
||||
mov r0, sl
|
||||
str r1, [sp]
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r7, #4]
|
||||
bl ov10_022BFA3C
|
||||
mov r4, r0
|
||||
mov r0, sl
|
||||
ldr r6, [sl, #0xb4]
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r5, r0
|
||||
bl GetMoveAnimation
|
||||
ldrsh r0, [r0, #2]
|
||||
cmp r0, #0
|
||||
beq _023251E0
|
||||
mov r0, sl
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r6, #4]
|
||||
bl ov10_022BF01C
|
||||
mov r2, r0
|
||||
mvn r0, #0
|
||||
cmp r2, r0
|
||||
ldreq r0, _02325608 ; =ov29_02352AD8
|
||||
ldreqh r1, [r0, #4]
|
||||
streqh r1, [sp, #0xc]
|
||||
ldreqh r0, [r0, #6]
|
||||
streqh r0, [sp, #0xe]
|
||||
beq _023251A8
|
||||
add r0, sp, #0xc
|
||||
add r1, sl, #0x2c
|
||||
and r2, r2, #0xff
|
||||
bl sub_0201CF90
|
||||
_023251A8:
|
||||
strh r5, [sp, #4]
|
||||
ldrsh r1, [r6, #4]
|
||||
mov r0, #0
|
||||
strh r1, [sp, #6]
|
||||
ldr r1, [sl, #0xc]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #8]
|
||||
ldr r1, [sl, #0x10]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #0xa]
|
||||
ldrb r1, [r6, #0x4c]
|
||||
str r1, [sp, #0x10]
|
||||
str r0, [sp, #0x14]
|
||||
b _023251E8
|
||||
_023251E0:
|
||||
mov r0, #0
|
||||
strh r0, [sp, #4]
|
||||
_023251E8:
|
||||
add r0, sp, #4
|
||||
mov r1, #1
|
||||
bl ov10_022BF1FC
|
||||
cmp r0, #0
|
||||
ldrne r0, _0232560C ; =DUNGEON_PTR
|
||||
ldrne r0, [r0]
|
||||
addne r0, r0, #0x1a000
|
||||
ldrne r5, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
bne _02325228
|
||||
ldrh r0, [sb, #4]
|
||||
cmp r0, #0x52
|
||||
ldreq r0, _0232560C ; =DUNGEON_PTR
|
||||
ldreq r0, [r0]
|
||||
addeq r0, r0, #0x1a000
|
||||
ldreq r5, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
movne r5, sl
|
||||
_02325228:
|
||||
mov r0, r5
|
||||
bl EntityIsValid__02325620
|
||||
cmp r0, #0
|
||||
moveq r5, sl
|
||||
ldr r1, [r5, #0xc]
|
||||
mov r0, r5
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #8]
|
||||
ldr r1, [r5, #0x10]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #0xa]
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r0, sl
|
||||
mov r1, sb
|
||||
bl ov29_02325D20
|
||||
cmp r0, #0
|
||||
bne _02325600
|
||||
ldrh r0, [sb, #4]
|
||||
cmp r0, #0x128
|
||||
bne _023252E4
|
||||
mov r0, #7
|
||||
bl DungeonRandInt
|
||||
ldr r1, _0232560C ; =DUNGEON_PTR
|
||||
ldr r6, _02325610 ; =ov29_02352B1C
|
||||
ldr r3, [r1]
|
||||
ldr r2, _02325614 ; =ov29_0237CA84
|
||||
ldr r6, [r6, r0, lsl #2]
|
||||
str r0, [r2]
|
||||
add r0, r3, #0x1a000
|
||||
str r6, [r0, #0x234 + OV29_023250D4_OFFSET]
|
||||
ldr r1, [r1]
|
||||
mov r0, #0
|
||||
add r1, r1, #0x1a000
|
||||
ldr r3, [r1, #0x234 + OV29_023250D4_OFFSET]
|
||||
str r3, [r1, #0x238 + OV29_023250D4_OFFSET]
|
||||
ldr r1, [r2]
|
||||
add r1, r1, #4
|
||||
bl SetMessageLogPreprocessorArgsNumberVal
|
||||
ldr r1, _02325618 ; =0x00000EAA
|
||||
mov r0, r5
|
||||
bl LogMessageByIdWithPopupCheckUser
|
||||
mov r0, r5
|
||||
mov r1, #0x214
|
||||
bl ov29_022E56A0
|
||||
b _0232531C
|
||||
_023252E4:
|
||||
cmp r0, #0x76
|
||||
bne _0232531C
|
||||
ldr r2, _0232560C ; =DUNGEON_PTR
|
||||
mov r3, #0xc
|
||||
ldr r1, [r2]
|
||||
mov r0, r5
|
||||
add r1, r1, #0x1a000
|
||||
str r3, [r1, #0x234 + OV29_023250D4_OFFSET]
|
||||
ldr r2, [r2]
|
||||
mov r1, #0x214
|
||||
add r2, r2, #0x1a000
|
||||
ldr r3, [r2, #0x234 + OV29_023250D4_OFFSET]
|
||||
str r3, [r2, #0x238 + OV29_023250D4_OFFSET]
|
||||
bl ov29_022E56A0
|
||||
_0232531C:
|
||||
mov r0, sl
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r7, #4]
|
||||
bl ov10_022BF0F4
|
||||
cmp r0, #0x3f00
|
||||
beq _02325354
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
bl ov29_022EACCC
|
||||
_02325354:
|
||||
cmp r4, #0x63
|
||||
bne _023253C8
|
||||
mov r0, r5
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r3, r8
|
||||
add r0, sp, #4
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
ldrb r8, [r7, #0x4c]
|
||||
bl ov29_02325644
|
||||
mov r7, #0
|
||||
mov r6, r7
|
||||
mov r5, #2
|
||||
mov r4, #0x15
|
||||
_02325394:
|
||||
sub r0, r8, #1
|
||||
and r8, r0, #7
|
||||
mov r0, sl
|
||||
mov r1, r6
|
||||
mov r2, r8
|
||||
bl ChangeMonsterAnimation
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl ov29_022EA370
|
||||
add r7, r7, #1
|
||||
cmp r7, #8
|
||||
blt _02325394
|
||||
b _02325600
|
||||
_023253C8:
|
||||
cmp r4, #0x62
|
||||
bne _0232543C
|
||||
mov r0, r5
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
add r0, sp, #4
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
mov r3, r8
|
||||
ldrb r7, [r7, #0x4c]
|
||||
bl ov29_02325644
|
||||
mov r8, #0
|
||||
mov r6, r8
|
||||
mov r5, #2
|
||||
mov r4, #0x15
|
||||
_02325408:
|
||||
and r7, r7, #7
|
||||
mov r0, sl
|
||||
mov r1, r6
|
||||
mov r2, r7
|
||||
bl ChangeMonsterAnimation
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl ov29_022EA370
|
||||
add r8, r8, #1
|
||||
cmp r8, #8
|
||||
add r7, r7, #1
|
||||
ble _02325408
|
||||
b _02325600
|
||||
_0232543C:
|
||||
ldrb r0, [r7, #0xd8]
|
||||
mov fp, #0
|
||||
cmp r0, #2
|
||||
moveq fp, #1
|
||||
beq _02325470
|
||||
ldr r0, _0232560C ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x1a000
|
||||
ldr r1, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
cmp r1, sl
|
||||
ldrneb r0, [r0, #0x245 + OV29_023250D4_OFFSET]
|
||||
cmpne r0, #0
|
||||
movne fp, #1
|
||||
_02325470:
|
||||
ldrb r0, [sl, #0x28]
|
||||
cmp r0, #0
|
||||
bne _02325524
|
||||
mov r5, #0
|
||||
_02325480:
|
||||
ldr r0, _0232560C ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
add r0, r0, r5, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
ldr r6, [r0, #0xb78 + OV29_023250D4_OFFSET]
|
||||
mov r0, r6
|
||||
bl EntityIsValid__02325620
|
||||
cmp r0, #0
|
||||
cmpne r6, sl
|
||||
ldrneb r0, [r6, #0x28]
|
||||
cmpne r0, #0
|
||||
beq _023254C8
|
||||
ldr r1, [r6, #0xb4]
|
||||
mov r0, r6
|
||||
ldrb r1, [r1, #0x4c]
|
||||
bl ov29_02304A48
|
||||
mov r0, #0
|
||||
strb r0, [r6, #0x28]
|
||||
_023254C8:
|
||||
add r5, r5, #1
|
||||
cmp r5, #0x14
|
||||
blt _02325480
|
||||
mov r0, #0x59
|
||||
bl AdvanceFrame
|
||||
cmp fp, #0
|
||||
beq _02325500
|
||||
ldr r0, _0232561C ; =0x00000229
|
||||
bl GetSpriteIndex__02052708
|
||||
mov r1, r0
|
||||
mov r0, #1
|
||||
bl SetAndLoadCurrentAttackAnimation
|
||||
mov r5, r0
|
||||
b _02325530
|
||||
_02325500:
|
||||
ldrsh r0, [r7, #4]
|
||||
bl GetSpriteIndex__02052708
|
||||
mov r1, r0
|
||||
mov r0, #1
|
||||
bl SetAndLoadCurrentAttackAnimation
|
||||
mov r1, #0xff
|
||||
mov r5, r0
|
||||
strb r1, [sl, #0xaf]
|
||||
b _02325530
|
||||
_02325524:
|
||||
mov r0, #0x59
|
||||
bl AdvanceFrame
|
||||
ldrsh r5, [sl, #0xa8]
|
||||
_02325530:
|
||||
ldrb r2, [r7, #0x4c]
|
||||
mov r0, sl
|
||||
mov r1, r4
|
||||
bl ChangeMonsterAnimation
|
||||
ldrb r1, [sl, #0xae]
|
||||
mov r0, r5
|
||||
bl WanTableSpriteHasAnimationGroup
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
strb r0, [sl, #0x28]
|
||||
mov r7, #0
|
||||
strb r7, [sl, #0x21]
|
||||
mov r5, #0x59
|
||||
add fp, sp, #4
|
||||
b _023255D8
|
||||
_02325570:
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
add r0, sl, #0x2c
|
||||
bl sub_0201D1D4
|
||||
cmp r4, #0
|
||||
cmpne r4, #7
|
||||
mov r6, r0
|
||||
cmpne r4, #9
|
||||
orreq r6, r6, #2
|
||||
tst r6, #2
|
||||
beq _023255C4
|
||||
ldr r0, [sp]
|
||||
cmp r0, #0
|
||||
bne _023255C4
|
||||
mov r0, fp
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
mov r3, r8
|
||||
bl ov29_02325644
|
||||
mov r0, #1
|
||||
str r0, [sp]
|
||||
_023255C4:
|
||||
tst r6, #1
|
||||
ldreqb r0, [sl, #0x21]
|
||||
cmpeq r0, #0
|
||||
bne _023255E0
|
||||
add r7, r7, #1
|
||||
_023255D8:
|
||||
cmp r7, #0x78
|
||||
blt _02325570
|
||||
_023255E0:
|
||||
mov r0, #0
|
||||
strb r0, [sl, #0x21]
|
||||
ldrh r0, [sb, #4]
|
||||
bl ov10_022BFDCC
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r0, #1
|
||||
bl AnimationDelayOrSomething
|
||||
_02325600:
|
||||
add sp, sp, #0x18
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_02325608: .word ov29_02352AD8
|
||||
_0232560C: .word DUNGEON_PTR
|
||||
_02325610: .word ov29_02352B1C
|
||||
_02325614: .word ov29_0237CA84
|
||||
#ifdef JAPAN
|
||||
_02325618: .word 0x00000BEC
|
||||
#else
|
||||
_02325618: .word 0x00000EAA
|
||||
#endif
|
||||
_0232561C: .word 0x00000229
|
||||
arm_func_end ov29_023250D4
|
||||
|
|
|
|||
760
asm/overlay_29_02324BE8.s
Normal file
760
asm/overlay_29_02324BE8.s
Normal file
|
|
@ -0,0 +1,760 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_02324BE8.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ov29_02324BE8
|
||||
ov29_02324BE8: ; 0x02324BE8
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r1
|
||||
ldrh r3, [r5, #4]
|
||||
ldr r1, _02324C98 ; =0x00000163
|
||||
ldr r4, [r0, #0xb4]
|
||||
cmp r3, r1
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x20
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
ldrh r0, [r5, #2]
|
||||
tst r0, #1
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, r4, r5, pc}
|
||||
cmp r2, #0
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #5
|
||||
bne _02324C54
|
||||
mov r0, r5
|
||||
bl IsUsableWhileTaunted
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324C54:
|
||||
ldrb r0, [r4, #0xd0]
|
||||
cmp r0, #6
|
||||
bne _02324C90
|
||||
ldrh r0, [r5, #4]
|
||||
cmp r0, #0x160
|
||||
bne _02324C80
|
||||
#ifdef JAPAN
|
||||
ldrb r0, [r4, #0x140]
|
||||
#else
|
||||
ldrb r0, [r4, #0x144]
|
||||
#endif
|
||||
tst r0, #0x10
|
||||
bne _02324C90
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
_02324C80:
|
||||
ldrb r0, [r5]
|
||||
tst r0, #0x10
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
_02324C90:
|
||||
mov r0, #1
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
.align 2, 0
|
||||
_02324C98: .word 0x00000163
|
||||
arm_func_end ov29_02324BE8
|
||||
|
||||
arm_func_start ov29_02324C9C
|
||||
ov29_02324C9C: ; 0x02324C9C
|
||||
stmdb sp!, {lr}
|
||||
sub sp, sp, #0x104
|
||||
mov ip, #0
|
||||
mov lr, ip
|
||||
add r2, sp, #0
|
||||
b _02324CDC
|
||||
_02324CB4:
|
||||
ldr r3, [r0, lr, lsl #2]
|
||||
cmp r3, #0
|
||||
beq _02324CE4
|
||||
cmp r3, r1
|
||||
beq _02324CD8
|
||||
cmp ip, #0x40
|
||||
bge _02324CE4
|
||||
str r3, [r2, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324CD8:
|
||||
add lr, lr, #1
|
||||
_02324CDC:
|
||||
cmp lr, #0x41
|
||||
blt _02324CB4
|
||||
_02324CE4:
|
||||
mov lr, #0
|
||||
add r2, sp, #0
|
||||
b _02324D18
|
||||
_02324CF0:
|
||||
ldr r3, [r0, lr, lsl #2]
|
||||
cmp r3, #0
|
||||
beq _02324D20
|
||||
cmp r3, r1
|
||||
bne _02324D14
|
||||
cmp ip, #0x40
|
||||
bge _02324D20
|
||||
str r3, [r2, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324D14:
|
||||
add lr, lr, #1
|
||||
_02324D18:
|
||||
cmp lr, #0x41
|
||||
blt _02324CF0
|
||||
_02324D20:
|
||||
mov r2, #0
|
||||
add r1, sp, #0
|
||||
b _02324D34
|
||||
_02324D2C:
|
||||
str r2, [r1, ip, lsl #2]
|
||||
add ip, ip, #1
|
||||
_02324D34:
|
||||
cmp ip, #0x41
|
||||
blt _02324D2C
|
||||
mov r3, #0
|
||||
add r2, sp, #0
|
||||
_02324D44:
|
||||
ldr r1, [r2, r3, lsl #2]
|
||||
str r1, [r0, r3, lsl #2]
|
||||
add r3, r3, #1
|
||||
cmp r3, #0x41
|
||||
blt _02324D44
|
||||
add sp, sp, #0x104
|
||||
ldmia sp!, {pc}
|
||||
arm_func_end ov29_02324C9C
|
||||
|
||||
arm_func_start ov29_02324D60
|
||||
ov29_02324D60: ; 0x02324D60
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r1
|
||||
cmp r4, #0x97
|
||||
bne _02324D80
|
||||
bl GetApparentWeather
|
||||
cmp r0, #1
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r4, pc}
|
||||
_02324D80:
|
||||
mov r0, r4
|
||||
bl Is2TurnsMove
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end ov29_02324D60
|
||||
|
||||
arm_func_start UpdateMovePp
|
||||
UpdateMovePp: ; 0x02324D8C
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r0
|
||||
mov r4, r1
|
||||
bl EntityIsValid__02321438
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r3, r4, r5, pc}
|
||||
ldr r0, [r5, #0xb4]
|
||||
mov r1, #0
|
||||
_02324DAC:
|
||||
#ifdef JAPAN
|
||||
add r2, r0, #0x120
|
||||
#else
|
||||
add r2, r0, #0x124
|
||||
#endif
|
||||
ldrb r3, [r2, r1, lsl #3]
|
||||
add r2, r2, r1, lsl #3
|
||||
tst r3, #1
|
||||
movne r3, #1
|
||||
moveq r3, #0
|
||||
tst r3, #0xff
|
||||
beq _02324E34
|
||||
ldrh r3, [r2, #2]
|
||||
mov lr, #1
|
||||
tst r3, #0x10
|
||||
bicne r3, r3, #0x10
|
||||
strneh r3, [r2, #2]
|
||||
ldrh r3, [r2, #2]
|
||||
movne lr, #2
|
||||
tst r3, #0x40
|
||||
bicne r3, r3, #0x40
|
||||
strneh r3, [r2, #2]
|
||||
ldrh r3, [r2, #2]
|
||||
movne lr, #4
|
||||
tst r3, #8
|
||||
bicne r3, r3, #8
|
||||
strneh r3, [r2, #2]
|
||||
cmpne r4, #0
|
||||
beq _02324E34
|
||||
mov ip, #0
|
||||
b _02324E2C
|
||||
_02324E18:
|
||||
ldrb r3, [r2, #6]
|
||||
add ip, ip, #1
|
||||
cmp r3, #0
|
||||
subne r3, r3, #1
|
||||
strneb r3, [r2, #6]
|
||||
_02324E2C:
|
||||
cmp ip, lr
|
||||
blt _02324E18
|
||||
_02324E34:
|
||||
add r1, r1, #1
|
||||
cmp r1, #4
|
||||
blt _02324DAC
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end UpdateMovePp
|
||||
|
||||
arm_func_start GetDamageSourceWrapper
|
||||
GetDamageSourceWrapper: ; 0x02324E44
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0
|
||||
mov r0, r1
|
||||
bl LowerSshort
|
||||
mov r1, r0
|
||||
ldrh r0, [r4, #4]
|
||||
bl GetDamageSource
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end GetDamageSourceWrapper
|
||||
|
||||
arm_func_start LowerSshort
|
||||
LowerSshort: ; 0x02324E64
|
||||
cmp r0, #0
|
||||
moveq r0, #0
|
||||
movne r0, r0, lsl #0x10
|
||||
movne r0, r0, asr #0x10
|
||||
bx lr
|
||||
arm_func_end LowerSshort
|
||||
|
||||
arm_func_start ov29_02324E78
|
||||
ov29_02324E78: ; 0x02324E78
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x14
|
||||
mov r7, r0
|
||||
mov r6, r1
|
||||
mov r8, r2
|
||||
bl ShouldMovePlayAlternativeAnimation
|
||||
mov r4, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
bl ov10_022BFD58
|
||||
mov sl, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
bl GetMoveAnimation
|
||||
ldrsh r5, [r0]
|
||||
mov r0, r7
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
moveq r0, sl
|
||||
beq _023250C8
|
||||
mov r0, r7
|
||||
mov r1, r6
|
||||
bl ov29_02325D20
|
||||
cmp r0, #0
|
||||
movne r0, sl
|
||||
bne _023250C8
|
||||
cmp r8, #0
|
||||
moveq r0, sl
|
||||
beq _023250C8
|
||||
cmp r5, #0
|
||||
beq _023250C4
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, r4
|
||||
bl GetMoveAnimationId
|
||||
mov r4, r0
|
||||
ldrh r0, [r6, #4]
|
||||
ldr r5, [r7, #0xb4]
|
||||
bl ov10_022BFD8C
|
||||
mov sb, r0
|
||||
mov r0, r7
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [r6, #4]
|
||||
mov r2, #1
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r5, #4]
|
||||
bl ov10_022BF01C
|
||||
mov r2, r0
|
||||
mvn r0, #0
|
||||
cmp r2, r0
|
||||
ldreq r0, _023250D0 ; =ov29_02352AD8
|
||||
ldreqh r1, [r0, #8]
|
||||
streqh r1, [sp, #8]
|
||||
ldreqh r0, [r0, #0xa]
|
||||
streqh r0, [sp, #0xa]
|
||||
beq _02324F98
|
||||
add r0, sp, #8
|
||||
add r1, r7, #0x2c
|
||||
and r2, r2, #0xff
|
||||
bl sub_0201CF90
|
||||
_02324F98:
|
||||
strh r4, [sp]
|
||||
ldrsh r1, [r5, #4]
|
||||
add r0, sp, #0
|
||||
mov r2, #0
|
||||
strh r1, [sp, #2]
|
||||
ldr r3, [r7, #0xc]
|
||||
mov r1, #1
|
||||
mov r3, r3, asr #8
|
||||
strh r3, [sp, #4]
|
||||
ldr r3, [r7, #0x10]
|
||||
mov r3, r3, asr #8
|
||||
strh r3, [sp, #6]
|
||||
ldrb r3, [r5, #0x4c]
|
||||
str r3, [sp, #0xc]
|
||||
str r2, [sp, #0x10]
|
||||
bl ov29_02325D7C
|
||||
mov r0, #0x58
|
||||
bl AdvanceFrame
|
||||
add r0, sp, #0
|
||||
bl ov10_022BFAA8
|
||||
mov r1, r7
|
||||
mov r2, #5
|
||||
mov r8, r0
|
||||
bl ov29_022E6D68
|
||||
mov r0, #1
|
||||
bl ov29_022DE5F0
|
||||
mov r7, r0
|
||||
cmp sb, #0
|
||||
bne _0232506C
|
||||
ldrh r0, [r6, #4]
|
||||
bl ov10_022BFDEC
|
||||
cmp r0, #0
|
||||
beq _0232506C
|
||||
mov r6, #0
|
||||
bl ov29_022ED0C4
|
||||
mov r5, r0
|
||||
mov r0, #1
|
||||
bl ov29_022E3560
|
||||
mov r4, #0xff
|
||||
mov fp, #1
|
||||
b _02325064
|
||||
_0232503C:
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r5, r0, asr #0x10
|
||||
cmp r5, #0xff
|
||||
movgt r5, r4
|
||||
mov r0, r5
|
||||
movgt r6, fp
|
||||
bl ov29_022ED0D4
|
||||
mov r0, #0x26
|
||||
bl AdvanceFrame
|
||||
_02325064:
|
||||
cmp r6, #0
|
||||
beq _0232503C
|
||||
_0232506C:
|
||||
mov r0, r8, lsl #0x10
|
||||
mov r4, r0, asr #0x10
|
||||
mov r8, #0
|
||||
mov r6, #1
|
||||
mov r5, #0x26
|
||||
b _023250B0
|
||||
_02325084:
|
||||
beq _023250A8
|
||||
cmp r7, #0x20
|
||||
subgt r7, r7, #0x20
|
||||
movle r7, r8
|
||||
mov r0, r7, lsl #0x10
|
||||
mov r1, r6
|
||||
mov r0, r0, asr #0x10
|
||||
movle sb, r8
|
||||
bl ov29_022DE5D8
|
||||
_023250A8:
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_023250B0:
|
||||
mov r0, r4
|
||||
bl AnimationHasMoreFrames
|
||||
cmp r0, #0
|
||||
cmpne sb, #0
|
||||
bne _02325084
|
||||
_023250C4:
|
||||
mov r0, sl
|
||||
_023250C8:
|
||||
add sp, sp, #0x14
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_023250D0: .word ov29_02352AD8
|
||||
arm_func_end ov29_02324E78
|
||||
|
||||
arm_func_start ov29_023250D4
|
||||
ov29_023250D4: ; 0x023250D4
|
||||
#ifdef JAPAN
|
||||
#define OV29_023250D4_OFFSET -0xA4
|
||||
#else
|
||||
#define OV29_023250D4_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #0x18
|
||||
mov sl, r0
|
||||
mov sb, r1
|
||||
bl ShouldMovePlayAlternativeAnimation
|
||||
mov r8, r0
|
||||
ldr r7, [sl, #0xb4]
|
||||
mov r1, #0
|
||||
mov r0, sl
|
||||
str r1, [sp]
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r7, #4]
|
||||
bl ov10_022BFA3C
|
||||
mov r4, r0
|
||||
mov r0, sl
|
||||
ldr r6, [sl, #0xb4]
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r5, r0
|
||||
bl GetMoveAnimation
|
||||
ldrsh r0, [r0, #2]
|
||||
cmp r0, #0
|
||||
beq _023251E0
|
||||
mov r0, sl
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r6, #4]
|
||||
bl ov10_022BF01C
|
||||
mov r2, r0
|
||||
mvn r0, #0
|
||||
cmp r2, r0
|
||||
ldreq r0, _02325608 ; =ov29_02352AD8
|
||||
ldreqh r1, [r0, #4]
|
||||
streqh r1, [sp, #0xc]
|
||||
ldreqh r0, [r0, #6]
|
||||
streqh r0, [sp, #0xe]
|
||||
beq _023251A8
|
||||
add r0, sp, #0xc
|
||||
add r1, sl, #0x2c
|
||||
and r2, r2, #0xff
|
||||
bl sub_0201CF90
|
||||
_023251A8:
|
||||
strh r5, [sp, #4]
|
||||
ldrsh r1, [r6, #4]
|
||||
mov r0, #0
|
||||
strh r1, [sp, #6]
|
||||
ldr r1, [sl, #0xc]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #8]
|
||||
ldr r1, [sl, #0x10]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #0xa]
|
||||
ldrb r1, [r6, #0x4c]
|
||||
str r1, [sp, #0x10]
|
||||
str r0, [sp, #0x14]
|
||||
b _023251E8
|
||||
_023251E0:
|
||||
mov r0, #0
|
||||
strh r0, [sp, #4]
|
||||
_023251E8:
|
||||
add r0, sp, #4
|
||||
mov r1, #1
|
||||
bl ov10_022BF1FC
|
||||
cmp r0, #0
|
||||
ldrne r0, _0232560C ; =DUNGEON_PTR
|
||||
ldrne r0, [r0]
|
||||
addne r0, r0, #0x1a000
|
||||
ldrne r5, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
bne _02325228
|
||||
ldrh r0, [sb, #4]
|
||||
cmp r0, #0x52
|
||||
ldreq r0, _0232560C ; =DUNGEON_PTR
|
||||
ldreq r0, [r0]
|
||||
addeq r0, r0, #0x1a000
|
||||
ldreq r5, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
movne r5, sl
|
||||
_02325228:
|
||||
mov r0, r5
|
||||
bl EntityIsValid__02325620
|
||||
cmp r0, #0
|
||||
moveq r5, sl
|
||||
ldr r1, [r5, #0xc]
|
||||
mov r0, r5
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #8]
|
||||
ldr r1, [r5, #0x10]
|
||||
mov r1, r1, asr #8
|
||||
strh r1, [sp, #0xa]
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r0, sl
|
||||
mov r1, sb
|
||||
bl ov29_02325D20
|
||||
cmp r0, #0
|
||||
bne _02325600
|
||||
ldrh r0, [sb, #4]
|
||||
cmp r0, #0x128
|
||||
bne _023252E4
|
||||
mov r0, #7
|
||||
bl DungeonRandInt
|
||||
ldr r1, _0232560C ; =DUNGEON_PTR
|
||||
ldr r6, _02325610 ; =ov29_02352B1C
|
||||
ldr r3, [r1]
|
||||
ldr r2, _02325614 ; =ov29_0237CA84
|
||||
ldr r6, [r6, r0, lsl #2]
|
||||
str r0, [r2]
|
||||
add r0, r3, #0x1a000
|
||||
str r6, [r0, #0x234 + OV29_023250D4_OFFSET]
|
||||
ldr r1, [r1]
|
||||
mov r0, #0
|
||||
add r1, r1, #0x1a000
|
||||
ldr r3, [r1, #0x234 + OV29_023250D4_OFFSET]
|
||||
str r3, [r1, #0x238 + OV29_023250D4_OFFSET]
|
||||
ldr r1, [r2]
|
||||
add r1, r1, #4
|
||||
bl SetMessageLogPreprocessorArgsNumberVal
|
||||
ldr r1, _02325618 ; =0x00000EAA
|
||||
mov r0, r5
|
||||
bl LogMessageByIdWithPopupCheckUser
|
||||
mov r0, r5
|
||||
mov r1, #0x214
|
||||
bl ov29_022E56A0
|
||||
b _0232531C
|
||||
_023252E4:
|
||||
cmp r0, #0x76
|
||||
bne _0232531C
|
||||
ldr r2, _0232560C ; =DUNGEON_PTR
|
||||
mov r3, #0xc
|
||||
ldr r1, [r2]
|
||||
mov r0, r5
|
||||
add r1, r1, #0x1a000
|
||||
str r3, [r1, #0x234 + OV29_023250D4_OFFSET]
|
||||
ldr r2, [r2]
|
||||
mov r1, #0x214
|
||||
add r2, r2, #0x1a000
|
||||
ldr r3, [r2, #0x234 + OV29_023250D4_OFFSET]
|
||||
str r3, [r2, #0x238 + OV29_023250D4_OFFSET]
|
||||
bl ov29_022E56A0
|
||||
_0232531C:
|
||||
mov r0, sl
|
||||
bl GetApparentWeather
|
||||
mov r1, r0
|
||||
ldrh r0, [sb, #4]
|
||||
mov r2, r8
|
||||
bl GetMoveAnimationId
|
||||
mov r1, r0
|
||||
ldrsh r0, [r7, #4]
|
||||
bl ov10_022BF0F4
|
||||
cmp r0, #0x3f00
|
||||
beq _02325354
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
bl ov29_022EACCC
|
||||
_02325354:
|
||||
cmp r4, #0x63
|
||||
bne _023253C8
|
||||
mov r0, r5
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r3, r8
|
||||
add r0, sp, #4
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
ldrb r8, [r7, #0x4c]
|
||||
bl ov29_02325644
|
||||
mov r7, #0
|
||||
mov r6, r7
|
||||
mov r5, #2
|
||||
mov r4, #0x15
|
||||
_02325394:
|
||||
sub r0, r8, #1
|
||||
and r8, r0, #7
|
||||
mov r0, sl
|
||||
mov r1, r6
|
||||
mov r2, r8
|
||||
bl ChangeMonsterAnimation
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl ov29_022EA370
|
||||
add r7, r7, #1
|
||||
cmp r7, #8
|
||||
blt _02325394
|
||||
b _02325600
|
||||
_023253C8:
|
||||
cmp r4, #0x62
|
||||
bne _0232543C
|
||||
mov r0, r5
|
||||
bl ShouldDisplayEntityAdvanced
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
add r0, sp, #4
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
mov r3, r8
|
||||
ldrb r7, [r7, #0x4c]
|
||||
bl ov29_02325644
|
||||
mov r8, #0
|
||||
mov r6, r8
|
||||
mov r5, #2
|
||||
mov r4, #0x15
|
||||
_02325408:
|
||||
and r7, r7, #7
|
||||
mov r0, sl
|
||||
mov r1, r6
|
||||
mov r2, r7
|
||||
bl ChangeMonsterAnimation
|
||||
mov r0, r5
|
||||
mov r1, r4
|
||||
bl ov29_022EA370
|
||||
add r8, r8, #1
|
||||
cmp r8, #8
|
||||
add r7, r7, #1
|
||||
ble _02325408
|
||||
b _02325600
|
||||
_0232543C:
|
||||
ldrb r0, [r7, #0xd8]
|
||||
mov fp, #0
|
||||
cmp r0, #2
|
||||
moveq fp, #1
|
||||
beq _02325470
|
||||
ldr r0, _0232560C ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x1a000
|
||||
ldr r1, [r0, #0x22c + OV29_023250D4_OFFSET]
|
||||
cmp r1, sl
|
||||
ldrneb r0, [r0, #0x245 + OV29_023250D4_OFFSET]
|
||||
cmpne r0, #0
|
||||
movne fp, #1
|
||||
_02325470:
|
||||
ldrb r0, [sl, #0x28]
|
||||
cmp r0, #0
|
||||
bne _02325524
|
||||
mov r5, #0
|
||||
_02325480:
|
||||
ldr r0, _0232560C ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
add r0, r0, r5, lsl #2
|
||||
add r0, r0, #0x12000
|
||||
ldr r6, [r0, #0xb78 + OV29_023250D4_OFFSET]
|
||||
mov r0, r6
|
||||
bl EntityIsValid__02325620
|
||||
cmp r0, #0
|
||||
cmpne r6, sl
|
||||
ldrneb r0, [r6, #0x28]
|
||||
cmpne r0, #0
|
||||
beq _023254C8
|
||||
ldr r1, [r6, #0xb4]
|
||||
mov r0, r6
|
||||
ldrb r1, [r1, #0x4c]
|
||||
bl ov29_02304A48
|
||||
mov r0, #0
|
||||
strb r0, [r6, #0x28]
|
||||
_023254C8:
|
||||
add r5, r5, #1
|
||||
cmp r5, #0x14
|
||||
blt _02325480
|
||||
mov r0, #0x59
|
||||
bl AdvanceFrame
|
||||
cmp fp, #0
|
||||
beq _02325500
|
||||
ldr r0, _0232561C ; =0x00000229
|
||||
bl GetSpriteIndex__02052708
|
||||
mov r1, r0
|
||||
mov r0, #1
|
||||
bl SetAndLoadCurrentAttackAnimation
|
||||
mov r5, r0
|
||||
b _02325530
|
||||
_02325500:
|
||||
ldrsh r0, [r7, #4]
|
||||
bl GetSpriteIndex__02052708
|
||||
mov r1, r0
|
||||
mov r0, #1
|
||||
bl SetAndLoadCurrentAttackAnimation
|
||||
mov r1, #0xff
|
||||
mov r5, r0
|
||||
strb r1, [sl, #0xaf]
|
||||
b _02325530
|
||||
_02325524:
|
||||
mov r0, #0x59
|
||||
bl AdvanceFrame
|
||||
ldrsh r5, [sl, #0xa8]
|
||||
_02325530:
|
||||
ldrb r2, [r7, #0x4c]
|
||||
mov r0, sl
|
||||
mov r1, r4
|
||||
bl ChangeMonsterAnimation
|
||||
ldrb r1, [sl, #0xae]
|
||||
mov r0, r5
|
||||
bl WanTableSpriteHasAnimationGroup
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
strb r0, [sl, #0x28]
|
||||
mov r7, #0
|
||||
strb r7, [sl, #0x21]
|
||||
mov r5, #0x59
|
||||
add fp, sp, #4
|
||||
b _023255D8
|
||||
_02325570:
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
add r0, sl, #0x2c
|
||||
bl sub_0201D1D4
|
||||
cmp r4, #0
|
||||
cmpne r4, #7
|
||||
mov r6, r0
|
||||
cmpne r4, #9
|
||||
orreq r6, r6, #2
|
||||
tst r6, #2
|
||||
beq _023255C4
|
||||
ldr r0, [sp]
|
||||
cmp r0, #0
|
||||
bne _023255C4
|
||||
mov r0, fp
|
||||
mov r1, sl
|
||||
mov r2, sb
|
||||
mov r3, r8
|
||||
bl ov29_02325644
|
||||
mov r0, #1
|
||||
str r0, [sp]
|
||||
_023255C4:
|
||||
tst r6, #1
|
||||
ldreqb r0, [sl, #0x21]
|
||||
cmpeq r0, #0
|
||||
bne _023255E0
|
||||
add r7, r7, #1
|
||||
_023255D8:
|
||||
cmp r7, #0x78
|
||||
blt _02325570
|
||||
_023255E0:
|
||||
mov r0, #0
|
||||
strb r0, [sl, #0x21]
|
||||
ldrh r0, [sb, #4]
|
||||
bl ov10_022BFDCC
|
||||
cmp r0, #0
|
||||
beq _02325600
|
||||
mov r0, #1
|
||||
bl AnimationDelayOrSomething
|
||||
_02325600:
|
||||
add sp, sp, #0x18
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_02325608: .word ov29_02352AD8
|
||||
_0232560C: .word DUNGEON_PTR
|
||||
_02325610: .word ov29_02352B1C
|
||||
_02325614: .word ov29_0237CA84
|
||||
#ifdef JAPAN
|
||||
_02325618: .word 0x00000BEC
|
||||
#else
|
||||
_02325618: .word 0x00000EAA
|
||||
#endif
|
||||
_0232561C: .word 0x00000229
|
||||
arm_func_end ov29_023250D4
|
||||
|
|
@ -313,83 +313,3 @@ NearbyAllyIqSkillIsEnabled: ; 0x02338288
|
|||
and r0, r0, #0xff
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end NearbyAllyIqSkillIsEnabled
|
||||
|
||||
arm_func_start ov29_023382A8
|
||||
ov29_023382A8: ; 0x023382A8
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
mov r7, r0
|
||||
ldr r0, [r7, #0xb4]
|
||||
mov r6, #0
|
||||
ldrb r0, [r0, #6]
|
||||
mov r5, #0
|
||||
ldr r4, _0233834C ; =DIRECTIONS_XY
|
||||
cmp r0, #0
|
||||
movne r6, #1
|
||||
b _0233833C
|
||||
_023382D0:
|
||||
mov r1, r5, lsl #2
|
||||
add r0, r4, r5, lsl #2
|
||||
ldrsh ip, [r7, #4]
|
||||
ldrsh r3, [r4, r1]
|
||||
ldrsh r2, [r7, #6]
|
||||
ldrsh r1, [r0, #2]
|
||||
add r0, ip, r3
|
||||
add r1, r2, r1
|
||||
bl GetTile
|
||||
ldr r0, [r0, #0xc]
|
||||
cmp r0, #0
|
||||
beq _02338330
|
||||
ldr r1, [r0]
|
||||
cmp r1, #1
|
||||
bne _02338330
|
||||
ldr r1, [r0, #0xb4]
|
||||
cmp r6, #0
|
||||
ldrb r1, [r1, #6]
|
||||
beq _02338328
|
||||
cmp r1, #0
|
||||
bne _02338330
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
_02338328:
|
||||
cmp r1, #0
|
||||
ldmneia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
_02338330:
|
||||
add r0, r5, #1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r5, r0, asr #0x10
|
||||
_0233833C:
|
||||
cmp r5, #8
|
||||
blt _023382D0
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_0233834C: .word DIRECTIONS_XY
|
||||
arm_func_end ov29_023382A8
|
||||
|
||||
arm_func_start ov29_02338350
|
||||
ov29_02338350: ; 0x02338350
|
||||
stmdb sp!, {r3, lr}
|
||||
bl ov29_023382A8
|
||||
cmp r0, #0
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
and r0, r0, #0xff
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end ov29_02338350
|
||||
|
||||
arm_func_start ResetGravity
|
||||
ResetGravity: ; 0x0233836C
|
||||
ldr r0, _02338388 ; =DUNGEON_PTR
|
||||
ldr ip, _0233838C ; =MemZero
|
||||
ldr r0, [r0]
|
||||
mov r1, #2
|
||||
#ifdef JAPAN
|
||||
add r0, r0, #0x258
|
||||
#else
|
||||
add r0, r0, #0x2fc
|
||||
#endif
|
||||
add r0, r0, #0x12800
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_02338388: .word DUNGEON_PTR
|
||||
_0233838C: .word MemZero
|
||||
arm_func_end ResetGravity
|
||||
|
|
|
|||
22
asm/overlay_29_0233836C.s
Normal file
22
asm/overlay_29_0233836C.s
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_0233836C.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ResetGravity
|
||||
ResetGravity: ; 0x0233836C
|
||||
ldr r0, _02338388 ; =DUNGEON_PTR
|
||||
ldr ip, _0233838C ; =MemZero
|
||||
ldr r0, [r0]
|
||||
mov r1, #2
|
||||
#ifdef JAPAN
|
||||
add r0, r0, #0x258
|
||||
#else
|
||||
add r0, r0, #0x2fc
|
||||
#endif
|
||||
add r0, r0, #0x12800
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_02338388: .word DUNGEON_PTR
|
||||
_0233838C: .word MemZero
|
||||
arm_func_end ResetGravity
|
||||
|
|
@ -2,12 +2,8 @@
|
|||
.include "overlay_29_bss_0237CA18.inc"
|
||||
|
||||
.bss
|
||||
.global AI_CAN_ATTACK_IN_DIRECTION
|
||||
AI_CAN_ATTACK_IN_DIRECTION:
|
||||
.space 0x8
|
||||
.global AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS
|
||||
AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS:
|
||||
.space 0x8
|
||||
; AI_POTENTIAL_ATTACK_TARGET_WEIGHTS is defined twice within AiConsiderMove, so it needs two separates globals until the function is matched.
|
||||
#ifndef NONMATCHING
|
||||
.global AI_POTENTIAL_ATTACK_TARGET_WEIGHTS
|
||||
AI_POTENTIAL_ATTACK_TARGET_WEIGHTS:
|
||||
.global AI_POTENTIAL_ATTACK_TARGET_WEIGHTS_2
|
||||
|
|
@ -16,6 +12,7 @@ AI_POTENTIAL_ATTACK_TARGET_WEIGHTS_2:
|
|||
.global AI_POTENTIAL_ATTACK_TARGETS
|
||||
AI_POTENTIAL_ATTACK_TARGETS:
|
||||
.space 0x20
|
||||
#endif
|
||||
.global ov29_0237CA68
|
||||
ov29_0237CA68:
|
||||
.space 0x1
|
||||
|
|
|
|||
|
|
@ -12,6 +12,15 @@ struct ai_possible_move
|
|||
s32 weight;
|
||||
};
|
||||
|
||||
// Stores whether the AI can use an attack in each direction.
|
||||
extern bool8 AI_CAN_ATTACK_IN_DIRECTION[NUM_DIRECTIONS];
|
||||
// Stores the directions that the AI can use an attack in. Parallel to AI_POTENTIAL_ATTACK_TARGET_WEIGHTS and AI_POTENTIAL_ATTACK_TARGETS.
|
||||
extern u8 AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS[NUM_DIRECTIONS];
|
||||
// Stores the targeting weights for each direction the AI can use an attack in. Parallel to AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS and AI_POTENTIAL_ATTACK_TARGETS.
|
||||
extern s32 AI_POTENTIAL_ATTACK_TARGET_WEIGHTS[NUM_DIRECTIONS];
|
||||
// Stores the target entity for each direction the AI can use an attack in. Parallel to AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS and AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS.
|
||||
extern struct entity *AI_POTENTIAL_ATTACK_TARGETS[NUM_DIRECTIONS];
|
||||
|
||||
// Sets all values in AI_CAN_ATTACK_IN_DIRECTION to false.
|
||||
void ResetAiCanAttackInDirection();
|
||||
// The AI uses this function to check if a move has any potential targets, to calculate the list of potential targets and to calculate the move's special weight. The weight is calculated using WeightMoveWithIqSkills.
|
||||
|
|
@ -44,5 +53,19 @@ s32 TryAddTargetToAiTargetList(s32 current_num_targets, s32 move_ai_range, struc
|
|||
bool8 IsAiTargetEligible(s32 move_ai_range, struct entity *user, struct entity *target, struct move *move, bool8 check_all_conditions);
|
||||
// Calculates a move weight used for deciding which target the move should be used on. If the user is an ally, the target is an enemy Pokémon, and the user has Exp. Go-Getter, Efficiency Expert, or Weak-Type Picker enabled, this function calculates a move weight based on that IQ skill's functionality. Otherwise, this function returns a weight of 1.
|
||||
s32 WeightMoveWithIqSkills(struct entity *user, s32 move_ai_range, struct entity *target, enum type_id move_type);
|
||||
// Decides which direction the AI will use its regular attack in.
|
||||
// pokemon: User entity pointer
|
||||
// target_dir: [output] direction that the regular attack should be targeted at.
|
||||
// skip_petrified: If true, the AI will ignore enemies that are petrified. If false, the AI will include petrified enemies when targeting.
|
||||
// return: True if there is a target for the regular attack, false if there is no target.
|
||||
bool8 TargetRegularAttack(struct entity *pokemon, u32 *target_dir, bool8 skip_petrified);
|
||||
// Returns true if the target is within range of the user's move, false otherwise.
|
||||
// If the user does not have Course Checker, it simply checks if the distance between user and target is less or equal than the move range.
|
||||
// Otherwise, it will iterate through all tiles in the direction specified, checking for walls or other monsters in the way, and return false if they are found.
|
||||
// user: user pointer
|
||||
// target: target pointer
|
||||
// direction: direction ID
|
||||
// n_tiles: move range (in number of tiles)
|
||||
bool8 IsTargetInRange(struct entity *user, struct entity *target, s32 direction, s32 n_tiles);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_AI_ATTACK_H
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef PMDSKY_DUNGEON_AI_ATTACK_1_H
|
||||
#define PMDSKY_DUNGEON_AI_ATTACK_1_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Returns true if the target is within range of the user's move, false otherwise.
|
||||
// If the user does not have Course Checker, it simply checks if the distance between user and target is less or equal than the move range.
|
||||
// Otherwise, it will iterate through all tiles in the direction specified, checking for walls or other monsters in the way, and return false if they are found.
|
||||
// user: user pointer
|
||||
// target: target pointer
|
||||
// direction: direction ID
|
||||
// n_tiles: move range (in number of tiles)
|
||||
bool8 IsTargetInRange(struct entity *user, struct entity *target, s32 direction, s32 n_tiles);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_AI_ATTACK_1_H
|
||||
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Used in GetPossibleAiThrownItemDirections to indicate whether a certain direction enum value is already being used or not.
|
||||
extern bool8 AI_THROWN_ITEM_DIRECTION_IS_USED[NUM_DIRECTIONS];
|
||||
// Used to store the probabilities matching the directions in THROWN_ITEM_DIRECTIONS.
|
||||
extern u32 AI_THROWN_ITEM_PROBABILITIES[NUM_DIRECTIONS];
|
||||
// Used to store the directions output by GetPossibleAiThrownItemDirections.
|
||||
extern u32 AI_THROWN_ITEM_DIRECTIONS[NUM_DIRECTIONS];
|
||||
|
||||
// Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity).
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Checks if a monster is levitating (has the effect of Levitate and Gravity is not active).
|
||||
bool8 LevitateIsActive(struct entity* entity);
|
||||
// Checks if a monster is a given type.
|
||||
bool8 MonsterIsType(struct entity *entity, enum type_id type_id);
|
||||
|
||||
|
|
|
|||
22
include/dungeon_move_util.h
Normal file
22
include/dungeon_move_util.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef PMDSKY_DUNGEON_MOVE_UTIL_H
|
||||
#define PMDSKY_DUNGEON_MOVE_UTIL_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Checks if an AI-controlled monster can use a move.
|
||||
// Will return false if the any of the flags move::f_exists, move::f_subsequent_in_link_chain or move::f_disabled is true. The function does not check if the flag move::f_enabled_for_ai is set. This function also returns true if the call to CanMonsterUseMove is true.
|
||||
// The function contains a loop that is supposed to check other moves after the specified one, but the loop breaks after it finds a move that isn't linked, which is always true given the checks in place at the start of the function.
|
||||
// monster: Entity pointer
|
||||
// move_index: Move index
|
||||
// extra_checks: extra_checks parameter when calling CanMonsterUseMove
|
||||
// return: True if the AI can use the move (not accounting for move::f_enabled_for_ai)
|
||||
bool8 CanAiUseMove(struct entity *monster, u32 move_index, bool8 extra_checks);
|
||||
// Checks if a monster can use the given move.
|
||||
// Will always return true for the regular attack. Will return false if the move if the flag move::f_disabled is true, if the // flag move::f_sealed is true. More things will be checked if the extra_checks parameter is true.
|
||||
// monster: Entity pointer
|
||||
// move: Move pointer
|
||||
// extra_checks: True to check whether the move is out of PP, whether it can be used under the taunted status and whether the encore status prevents using the move
|
||||
// return: True if the monster can use the move, false otherwise.
|
||||
bool8 CanMonsterUseMove(struct entity *monster, struct move *move, bool8 extra_checks);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_MOVE_UTIL_H
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef PMDSKY_DUNGEON_PARAMETERS_H
|
||||
#define PMDSKY_DUNGEON_PARAMETERS_H
|
||||
|
||||
// The percentage chance of the AI not attacking when it is confused.
|
||||
extern const s16 AI_CONFUSED_NO_ATTACK_CHANCE;
|
||||
|
||||
#endif //PMDSKY_DUNGEON_PARAMETERS_H
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef PMDSKY_DUNGEON_PARAMETERS_1_H
|
||||
#define PMDSKY_DUNGEON_PARAMETERS_1_H
|
||||
|
||||
// The chance of the Chatot Scarf bouncing back a move, as a percentage (20%).
|
||||
extern const s16 CHATOT_SCARF_BOUNCE_CHANCE;
|
||||
|
||||
#endif //PMDSKY_DUNGEON_PARAMETERS_1_H
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "enums.h"
|
||||
|
||||
// Maps each weather type (by index, see enum weather_id) to the corresponding Weather Ball type.
|
||||
extern const enum type_id WEATHER_BALL_TYPE_TABLE[8];
|
||||
|
||||
#endif //PMDSKY_DUNGEON_PARAMETERS_1_H
|
||||
|
|
|
|||
8
include/main_0201398C.h
Normal file
8
include/main_0201398C.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef PMDSKY_MAIN_0201398C_H
|
||||
#define PMDSKY_MAIN_0201398C_H
|
||||
|
||||
#include "move.h"
|
||||
|
||||
s16 GetMoveAiWeight(struct move *move);
|
||||
|
||||
#endif //PMDSKY_MAIN_0201398C_H
|
||||
11
include/overlay_29_022EBC50.h
Normal file
11
include/overlay_29_022EBC50.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef PMDSKY_OVERLAY_29_022EBC50_H
|
||||
#define PMDSKY_OVERLAY_29_022EBC50_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Sets a monster's action to action::ACTION_REGULAR_ATTACK, with a specified direction.
|
||||
void SetActionRegularAttack(struct action_data *monster_action, u8 direction);
|
||||
// Sets a monster's action to action::ACTION_STRUGGLE, with a specified direction.
|
||||
void SetActionStruggle(struct action_data *monster_action, u8 direction);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_022EBC50_H
|
||||
10
include/overlay_29_0230AB58.h
Normal file
10
include/overlay_29_0230AB58.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef PMDSKY_OVERLAY_29_0230AB58_H
|
||||
#define PMDSKY_OVERLAY_29_0230AB58_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Checks whether Scrappy should activate.
|
||||
// Scrappy activates when the ability is active on the attacker, the move type is Normal or Fighting, and the defender is a Ghost type.
|
||||
bool8 ScrappyShouldActivate(struct entity *attacker, struct entity *defender, enum type_id attack_type);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0230AB58_H
|
||||
|
|
@ -5,5 +5,8 @@
|
|||
|
||||
// Checks if a monster is a team member under the effects of a certain exclusive item effect.
|
||||
bool8 ExclusiveItemEffectIsActive__0230F8AC(struct entity *entity, enum exclusive_item_effect_id effect_id);
|
||||
u8 FindDirectionOfAdjacentMonsterWithItem(struct entity *pokemon, enum item_id item_id);
|
||||
// Checks if an entity is a monster (entity type 1).
|
||||
bool8 IsMonster__0230F980(struct entity *entity);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0230F8AC_H
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef PMDSKY_OVERLAY_29_0230F980_H
|
||||
#define PMDSKY_OVERLAY_29_0230F980_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Checks if an entity is a monster (entity type 1).
|
||||
bool8 IsMonster__0230F980(struct entity *entity);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_0230F980_H
|
||||
9
include/overlay_29_02338350.h
Normal file
9
include/overlay_29_02338350.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef PMDSKY_OVERLAY_29_02338350_H
|
||||
#define PMDSKY_OVERLAY_29_02338350_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
struct entity* FindAdjacentEnemy(struct entity *monster);
|
||||
bool8 IsAdjacentToEnemyIgnoreTreatment(struct entity *monster);
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_02338350_H
|
||||
|
|
@ -3,17 +3,6 @@
|
|||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
// Type matchup table, not including TYPE_NEUTRAL.
|
||||
// Note that Ghost's immunities seem to be hard-coded elsewhere. In this table, both Normal and
|
||||
// Fighting are encoded as neutral against Ghost.
|
||||
//
|
||||
// Row index corresponds to the attack type and the column index corresponds to the defender type.
|
||||
// C-style access: type_matchup_table[attack_type][target_type] or
|
||||
// *(&type_matchup_table[0][0] + attack_type*18 + target_type)
|
||||
struct type_matchup_table {
|
||||
s16 matchups[NUM_TYPES][NUM_TYPES];
|
||||
};
|
||||
|
||||
s16 GetTypeMatchup(struct entity *attacker, struct entity *defender, s16 target_type_idx, enum type_id attack_type);
|
||||
|
||||
#endif //PMDSKY_TYPE_EFFECTIVENESS_H
|
||||
|
|
|
|||
18
include/type_matchup_table.h
Normal file
18
include/type_matchup_table.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef PMDSKY_TYPE_MATCHUP_TABLE_H
|
||||
#define PMDSKY_TYPE_MATCHUP_TABLE_H
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
// Type matchup table, not including TYPE_NEUTRAL.
|
||||
// Note that Ghost's immunities seem to be hard-coded elsewhere. In this table, both Normal and
|
||||
// Fighting are encoded as neutral against Ghost.
|
||||
// Row index corresponds to the attack type and the column index corresponds to the defender type.
|
||||
struct type_matchup_table {
|
||||
s16 matchups[NUM_TYPES][NUM_TYPES];
|
||||
};
|
||||
|
||||
// Table of type matchups.
|
||||
// Each row corresponds to the type matchups of a specific attack type, with each entry within the row specifying the type's effectiveness against a target type.
|
||||
extern const struct type_matchup_table TYPE_MATCHUP_TABLE;
|
||||
|
||||
#endif //PMDSKY_TYPE_MATCHUP_TABLE_H
|
||||
18
main.lsf
18
main.lsf
|
|
@ -51,6 +51,8 @@ Static main
|
|||
Object asm/main_020137E8.o
|
||||
Object src/moves_2.o
|
||||
Object asm/main_02013884.o
|
||||
Object src/main_0201398C.o
|
||||
Object asm/main_020139AC.o
|
||||
Object src/moves_4.o
|
||||
Object asm/main_02013A30.o
|
||||
Object src/moves.o
|
||||
|
|
@ -221,6 +223,8 @@ Overlay OVY_10
|
|||
Object asm/overlay_10_rodata_022C490C.o
|
||||
Object src/natural_gift_data.o
|
||||
Object asm/overlay_10_rodata_022C593C.o
|
||||
Object src/type_matchup_table.o
|
||||
Object asm/overlay_10_022C5938.o
|
||||
}
|
||||
Overlay OVY_11
|
||||
{
|
||||
|
|
@ -371,6 +375,8 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_022EAB50.o
|
||||
Object src/dungeon_action.o
|
||||
Object asm/overlay_29_022EB44C.o
|
||||
Object src/overlay_29_022EBC50.o
|
||||
Object asm/overlay_29_022EBC98.o
|
||||
Object src/dungeon_action_helper.o
|
||||
Object asm/overlay_29_022EBCE8.o
|
||||
Object src/overlay_29_022EC608.o
|
||||
|
|
@ -478,6 +484,8 @@ Overlay OVY_29
|
|||
Object src/overlay_29_0230A994.o
|
||||
Object src/overlay_29_0230A9DC.o
|
||||
Object asm/overlay_29_0230AA0C.o
|
||||
Object src/overlay_29_0230AB58.o
|
||||
Object asm/overlay_29_0230ABF0.o
|
||||
Object src/type_effectiveness.o
|
||||
Object asm/overlay_29_0230AD04.o
|
||||
Object src/dungeon_damage.o
|
||||
|
|
@ -488,13 +496,10 @@ Overlay OVY_29
|
|||
Object src/dungeon_ai_items.o
|
||||
Object src/dungeon_ai_items_1.o
|
||||
Object asm/overlay_29_data_02353700.o
|
||||
Object asm/overlay_29_bss_0237CA18.o
|
||||
Object asm/overlay_29_0230F02C.o
|
||||
Object src/overlay_29_0230F810.o
|
||||
Object asm/overlay_29_0230F840.o
|
||||
Object src/overlay_29_0230F8AC.o
|
||||
Object asm/overlay_29_0230F8D0.o
|
||||
Object src/overlay_29_0230F980.o
|
||||
Object asm/overlay_29_0230F9A4.o
|
||||
Object src/overlay_29_02311010.o
|
||||
Object asm/overlay_29_02311088.o
|
||||
|
|
@ -520,8 +525,7 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_02318E70.o
|
||||
Object src/inflict_status.o
|
||||
Object src/dungeon_ai_attack.o
|
||||
Object asm/overlay_29_0231A460.o
|
||||
Object src/dungeon_ai_attack_1.o
|
||||
Object asm/overlay_29_bss_0237CA18.o
|
||||
Object asm/overlay_29_0231A7A0.o
|
||||
Object src/overlay_29_0231A87C.o
|
||||
Object asm/overlay_29_0231A8A0.o
|
||||
|
|
@ -560,6 +564,8 @@ Overlay OVY_29
|
|||
Object src/dungeon_move.o
|
||||
Object asm/overlay_29_rodata_02352A6C.o
|
||||
Object asm/overlay_29_02324698.o
|
||||
Object src/dungeon_move_util.o
|
||||
Object asm/overlay_29_02324BE8.o
|
||||
Object src/overlay_29_02325620.o
|
||||
Object asm/overlay_29_02325644.o
|
||||
Object src/overlay_29_0232800C.o
|
||||
|
|
@ -587,6 +593,8 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_02337CCC.o
|
||||
Object src/dungeon_map_access_1.o
|
||||
Object asm/overlay_29_02337EC0.o
|
||||
Object src/overlay_29_02338350.o
|
||||
Object asm/overlay_29_0233836C.o
|
||||
Object src/overlay_29_02338390.o
|
||||
Object asm/overlay_29_023383A8.o
|
||||
Object src/overlay_29_02338548.o
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "dungeon_ai_attack.h"
|
||||
#include "dg_random.h"
|
||||
#include "dungeon_ai_attack_1.h"
|
||||
#include "dungeon_ai_targeting_1.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_capabilities_4.h"
|
||||
|
|
@ -22,13 +21,18 @@
|
|||
#include "moves_2.h"
|
||||
#include "moves_3.h"
|
||||
#include "moves_4.h"
|
||||
#include "overlay_29_0230F8AC.h"
|
||||
#include "overlay_29_0231ACAC.h"
|
||||
#include "position_util.h"
|
||||
|
||||
extern bool8 AI_CAN_ATTACK_IN_DIRECTION[NUM_DIRECTIONS];
|
||||
extern u8 AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS[NUM_DIRECTIONS];
|
||||
extern s32 AI_POTENTIAL_ATTACK_TARGET_WEIGHTS[NUM_DIRECTIONS];
|
||||
extern struct entity *AI_POTENTIAL_ATTACK_TARGETS[NUM_DIRECTIONS];
|
||||
bool8 AI_CAN_ATTACK_IN_DIRECTION[NUM_DIRECTIONS] = {0};
|
||||
u8 AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS[NUM_DIRECTIONS] = {0};
|
||||
|
||||
// AI_POTENTIAL_ATTACK_TARGET_WEIGHTS is defined twice within AiConsiderMove, so it needs two separate symbols in ASM until the function is matched.
|
||||
#ifdef NONMATCHING
|
||||
s32 AI_POTENTIAL_ATTACK_TARGET_WEIGHTS[NUM_DIRECTIONS] = {0};
|
||||
struct entity *AI_POTENTIAL_ATTACK_TARGETS[NUM_DIRECTIONS] = {0};
|
||||
#endif
|
||||
|
||||
void ResetAiCanAttackInDirection()
|
||||
{
|
||||
|
|
@ -928,3 +932,121 @@ s32 WeightMoveWithIqSkills(struct entity *user, s32 move_ai_range, struct entity
|
|||
|
||||
return weight;
|
||||
}
|
||||
|
||||
bool8 TargetRegularAttack(struct entity *pokemon, u32 *target_dir, bool8 skip_petrified)
|
||||
{
|
||||
s32 num_potential_targets = 0;
|
||||
s32 i;
|
||||
struct monster *pokemon_info = GetEntInfo(pokemon);
|
||||
s32 direction = pokemon_info->action.direction;
|
||||
s32 face_turn_limit;
|
||||
if (IsBlinded(pokemon, TRUE))
|
||||
face_turn_limit = 1;
|
||||
else
|
||||
{
|
||||
u8 gaggle_specs_direction = FindDirectionOfAdjacentMonsterWithItem(pokemon, ITEM_GAGGLE_SPECS);
|
||||
face_turn_limit = 8;
|
||||
if (gaggle_specs_direction != DIR_NONE_UNSIGNED)
|
||||
direction = gaggle_specs_direction;
|
||||
}
|
||||
|
||||
s32 potential_attack_target_directions[NUM_DIRECTIONS];
|
||||
s32 potential_attack_target_weights[NUM_DIRECTIONS];
|
||||
bool8 has_targeting_iq = IqSkillIsEnabled(pokemon, IQ_EXP_GO_GETTER) || IqSkillIsEnabled(pokemon, IQ_EFFICIENCY_EXPERT);
|
||||
bool8 has_status_checker = IqSkillIsEnabled(pokemon, IQ_STATUS_CHECKER);
|
||||
for (i = 0; i < face_turn_limit; i++, direction++)
|
||||
{
|
||||
struct entity *target;
|
||||
direction &= DIRECTION_MASK;
|
||||
target = GetTile(pokemon->pos.x + DIRECTIONS_XY[direction].x, pokemon->pos.y + DIRECTIONS_XY[direction].y)->monster;
|
||||
if (target != NULL &&
|
||||
GetEntityType(target) == ENTITY_MONSTER &&
|
||||
CanAttackInDirection(pokemon, direction) &&
|
||||
GetTreatmentBetweenMonsters(pokemon, target, FALSE, skip_petrified) == TREATMENT_TREAT_AS_ENEMY &&
|
||||
(!has_status_checker || GetEntInfo(target)->frozen_class_status.freeze != STATUS_FROZEN_FROZEN))
|
||||
{
|
||||
potential_attack_target_directions[num_potential_targets] = direction;
|
||||
potential_attack_target_weights[num_potential_targets] = WeightMoveWithIqSkills(pokemon, TARGET_ENEMIES, target, TYPE_NONE);
|
||||
if (!has_targeting_iq)
|
||||
{
|
||||
*target_dir = direction;
|
||||
return TRUE;
|
||||
}
|
||||
num_potential_targets++;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_potential_targets == 0)
|
||||
return FALSE;
|
||||
|
||||
s32 total_weight = 0;
|
||||
s32 max_weight = 0;
|
||||
s32 weight_counter;
|
||||
for (i = 0; i < num_potential_targets; i++)
|
||||
{
|
||||
if (max_weight < potential_attack_target_weights[i])
|
||||
max_weight = potential_attack_target_weights[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < num_potential_targets; i++)
|
||||
{
|
||||
if (max_weight != potential_attack_target_weights[i])
|
||||
potential_attack_target_weights[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_potential_targets; i++)
|
||||
{
|
||||
total_weight += potential_attack_target_weights[i];
|
||||
}
|
||||
|
||||
weight_counter = DungeonRandInt(total_weight);
|
||||
for (i = 0; i < num_potential_targets; i++)
|
||||
{
|
||||
weight_counter -= potential_attack_target_weights[i];
|
||||
if (weight_counter < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
*target_dir = potential_attack_target_directions[i];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 IsTargetInRange(struct entity *user, struct entity *target, s32 direction, s32 n_tiles)
|
||||
{
|
||||
s32 effective_max_range = Max(abs(user->pos.x - target->pos.x), abs(user->pos.y - target->pos.y));
|
||||
|
||||
if (effective_max_range > n_tiles)
|
||||
effective_max_range = n_tiles;
|
||||
|
||||
if (!IqSkillIsEnabled(user, IQ_COURSE_CHECKER))
|
||||
// BUG: effective_max_range is already capped at max_range, so this condition always evaluates to TRUE.
|
||||
// The AI also has range checks elsewhere, so this doesn't become an issue in most cases.
|
||||
// If the AI has the Long Toss or Pierce statuses and Course Checker is disabled,
|
||||
// this incorrect check causes the AI to throw items at targets further than 10 tiles away.
|
||||
return effective_max_range <= n_tiles;
|
||||
|
||||
s32 i;
|
||||
s32 current_pos_x = user->pos.x;
|
||||
s32 current_pos_y = user->pos.y;
|
||||
s32 adjacent_tile_offset_x = DIRECTIONS_XY[direction].x;
|
||||
s32 adjacent_tile_offset_y = DIRECTIONS_XY[direction].y;
|
||||
for (i = 0; i <= effective_max_range; i++)
|
||||
{
|
||||
current_pos_x += adjacent_tile_offset_x;
|
||||
current_pos_y += adjacent_tile_offset_y;
|
||||
if (current_pos_x < 1 || current_pos_y < 1 ||
|
||||
current_pos_x >= DUNGEON_MAX_SIZE_X - 1 || current_pos_y >= DUNGEON_MAX_SIZE_Y - 1)
|
||||
break;
|
||||
|
||||
const struct tile *map_tile = GetTile(current_pos_x, current_pos_y);
|
||||
if (GetTerrainType(map_tile) == TERRAIN_TYPE_WALL)
|
||||
return FALSE;
|
||||
|
||||
if (map_tile->monster == target)
|
||||
return TRUE;
|
||||
|
||||
if (map_tile->monster != NULL)
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
#include "dungeon_ai_attack_1.h"
|
||||
#include "dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_pokemon_attributes_1.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "main_0208655C.h"
|
||||
#include "util.h"
|
||||
|
||||
bool8 IsTargetInRange(struct entity *user, struct entity *target, s32 direction, s32 n_tiles)
|
||||
{
|
||||
s32 effective_max_range = Max(abs(user->pos.x - target->pos.x), abs(user->pos.y - target->pos.y));
|
||||
|
||||
if (effective_max_range > n_tiles)
|
||||
effective_max_range = n_tiles;
|
||||
|
||||
if (!IqSkillIsEnabled(user, IQ_COURSE_CHECKER))
|
||||
// BUG: effective_max_range is already capped at max_range, so this condition always evaluates to TRUE.
|
||||
// The AI also has range checks elsewhere, so this doesn't become an issue in most cases.
|
||||
// If the AI has the Long Toss or Pierce statuses and Course Checker is disabled,
|
||||
// this incorrect check causes the AI to throw items at targets further than 10 tiles away.
|
||||
return effective_max_range <= n_tiles;
|
||||
|
||||
s32 i;
|
||||
s32 current_pos_x = user->pos.x;
|
||||
s32 current_pos_y = user->pos.y;
|
||||
s32 adjacent_tile_offset_x = DIRECTIONS_XY[direction].x;
|
||||
s32 adjacent_tile_offset_y = DIRECTIONS_XY[direction].y;
|
||||
for (i = 0; i <= effective_max_range; i++)
|
||||
{
|
||||
current_pos_x += adjacent_tile_offset_x;
|
||||
current_pos_y += adjacent_tile_offset_y;
|
||||
if (current_pos_x < 1 || current_pos_y < 1 ||
|
||||
current_pos_x >= DUNGEON_MAX_SIZE_X - 1 || current_pos_y >= DUNGEON_MAX_SIZE_Y - 1)
|
||||
break;
|
||||
|
||||
const struct tile *map_tile = GetTile(current_pos_x, current_pos_y);
|
||||
if (GetTerrainType(map_tile) == TERRAIN_TYPE_WALL)
|
||||
return FALSE;
|
||||
|
||||
if (map_tile->monster == target)
|
||||
return TRUE;
|
||||
|
||||
if (map_tile->monster != NULL)
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -12,20 +12,18 @@
|
|||
#include "dungeon_misc.h"
|
||||
#include "dungeon_mode.h"
|
||||
#include "dungeon_move.h"
|
||||
#include "dungeon_move_util.h"
|
||||
#include "dungeon_parameters.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_pokemon_attributes_1.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "fixed_room_data.h"
|
||||
#include "moves_1.h"
|
||||
#include "overlay_29_022EBC50.h"
|
||||
#include "overlay_29_02338350.h"
|
||||
|
||||
#define REGULAR_ATTACK_INDEX 4
|
||||
|
||||
extern bool8 ov29_02338350(struct entity *monster);
|
||||
extern bool8 TargetRegularAttack(struct entity *pokemon, u32 *target_dir, bool8 skip_petrified);
|
||||
extern void SetActionRegularAttack(struct action_data *monster_action, u8 direction);
|
||||
extern void SetActionStruggle(struct action_data *monster_action, u8 direction);
|
||||
extern bool8 CanAiUseMove(struct entity *monster, u32 move_index, bool8 extra_checks);
|
||||
extern u8 GetMoveAiWeight(struct move *move);
|
||||
|
||||
#ifdef SDK_ARM9
|
||||
|
|
@ -46,7 +44,7 @@ void ChooseAiMove(struct entity *monster)
|
|||
(pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_CONFUSED && DungeonRandOutcome__022EAB20(AI_CONFUSED_NO_ATTACK_CHANCE)))
|
||||
return;
|
||||
|
||||
int i;
|
||||
s32 i;
|
||||
if (pokemon_info->bide_class_status.bide != STATUS_TWO_TURN_NONE)
|
||||
{
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
|
|
@ -229,14 +227,14 @@ void ChooseAiMove(struct entity *monster)
|
|||
|
||||
bool8 can_target_regular_attack;
|
||||
s32 weight_counter = 0;
|
||||
bool8 has_stall = FALSE;
|
||||
if (AbilityIsActiveVeneer(monster, ABILITY_STALL) && !ov29_02338350(monster))
|
||||
bool8 has_stall_with_no_adjacent_enemies = FALSE;
|
||||
if (AbilityIsActiveVeneer(monster, ABILITY_STALL) && !IsAdjacentToEnemyIgnoreTreatment(monster))
|
||||
{
|
||||
has_stall = TRUE;
|
||||
has_stall_with_no_adjacent_enemies = TRUE;
|
||||
can_target_regular_attack = TargetRegularAttack(monster, ®ular_attack_target_dir, TRUE);
|
||||
}
|
||||
|
||||
if (!has_stall)
|
||||
if (!has_stall_with_no_adjacent_enemies)
|
||||
{
|
||||
if (!IqSkillIsEnabled(monster, IQ_EXCLUSIVE_MOVE_USER))
|
||||
can_target_regular_attack = TargetRegularAttack(monster, ®ular_attack_target_dir, TRUE);
|
||||
|
|
@ -254,7 +252,7 @@ void ChooseAiMove(struct entity *monster)
|
|||
weight_counter += ai_possible_move[i].weight;
|
||||
if (weight_counter >= random_weight)
|
||||
{
|
||||
if (has_stall || i == REGULAR_ATTACK_INDEX)
|
||||
if (has_stall_with_no_adjacent_enemies || i == REGULAR_ATTACK_INDEX)
|
||||
{
|
||||
if (can_target_regular_attack)
|
||||
{
|
||||
|
|
@ -683,7 +681,7 @@ _01FFBB80:
|
|||
cmp r0, #0
|
||||
beq _01FFBBD8
|
||||
mov r0, r10
|
||||
bl ov29_02338350
|
||||
bl IsAdjacentToEnemyIgnoreTreatment
|
||||
cmp r0, #0
|
||||
bne _01FFBBD8
|
||||
mov r6, #1
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include "dg_random.h"
|
||||
#include "dungeon.h"
|
||||
#include "dungeon_ai_attack.h"
|
||||
#include "dungeon_ai_attack_1.h"
|
||||
#include "dungeon_ai_item_weight.h"
|
||||
#include "dungeon_ai_items.h"
|
||||
#include "dungeon_ai_targeting_1.h"
|
||||
|
|
|
|||
|
|
@ -5,17 +5,13 @@
|
|||
#include "move_orb_effects.h"
|
||||
#include "overlay_29_02308FBC.h"
|
||||
#include "overlay_29_0230A994.h"
|
||||
#include "overlay_29_0230AB58.h"
|
||||
#include "overlay_29_02318A4C.h"
|
||||
#include "type_effectiveness.h"
|
||||
#include "weather.h"
|
||||
|
||||
#define NUM_EFFECTIVENESS 4
|
||||
|
||||
extern enum type_matchup GetTypeMatchup(struct entity *attacker, struct entity *defender, s16 target_type_idx, enum type_id attack_type);
|
||||
extern bool8 LevitateIsActive(struct entity* entity);
|
||||
extern bool8 ScrappyShouldActivate(struct entity *attacker, struct entity *defender, enum type_id attack_type);
|
||||
|
||||
// https://decomp.me/scratch/j2xpy
|
||||
// https://decomp.me/scratch/fk1Fo
|
||||
s32 WeightWeakTypePicker(struct entity *user, struct entity *target, enum type_id move_type)
|
||||
{
|
||||
s32 weight = 1;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
#include "dungeon_logic_3.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "overlay_29_02338390.h"
|
||||
|
||||
bool8 LevitateIsActive(struct entity* entity)
|
||||
{
|
||||
if (GravityIsActive())
|
||||
return FALSE;
|
||||
|
||||
if (AbilityIsActive(entity, ABILITY_LEVITATE))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MonsterIsType(struct entity *entity, enum type_id type_id)
|
||||
{
|
||||
|
|
|
|||
72
src/dungeon_move_util.c
Normal file
72
src/dungeon_move_util.c
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#include "dungeon_move_util.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "move.h"
|
||||
#include "moves_3.h"
|
||||
|
||||
bool8 CanAiUseMove(struct entity *monster, u32 move_index, bool8 extra_checks)
|
||||
{
|
||||
s32 i;
|
||||
struct monster *pokemon_info = GetEntInfo(monster);
|
||||
|
||||
struct move *move = &pokemon_info->moves.moves[move_index];
|
||||
if (!MoveExists(move))
|
||||
return FALSE;
|
||||
|
||||
if (move->flags0 & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
|
||||
return FALSE;
|
||||
|
||||
if (move->flags0 & MOVE_FLAG_DISABLED)
|
||||
return FALSE;
|
||||
|
||||
if (move->flags2 & MOVE_FLAG_SEALED)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++) {
|
||||
if (CanMonsterUseMove(monster, move, extra_checks))
|
||||
return TRUE;
|
||||
|
||||
move++;
|
||||
if (move >= &pokemon_info->moves.moves[MAX_MON_MOVES])
|
||||
break;
|
||||
|
||||
if (!(move->flags0 & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CanMonsterUseMove(struct entity *monster, struct move *move, bool8 extra_checks)
|
||||
{
|
||||
struct monster *pokemon_info = GetEntInfo(monster);
|
||||
if (move->id == MOVE_REGULAR_ATTACK)
|
||||
return TRUE;
|
||||
|
||||
if (move->flags0 & MOVE_FLAG_DISABLED)
|
||||
return FALSE;
|
||||
|
||||
if (move->flags2 & MOVE_FLAG_SEALED)
|
||||
return FALSE;
|
||||
|
||||
if (!extra_checks)
|
||||
return TRUE;
|
||||
|
||||
if (move->pp == 0)
|
||||
return FALSE;
|
||||
|
||||
if (pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_TAUNTED && !IsUsableWhileTaunted(move))
|
||||
return FALSE;
|
||||
|
||||
if (pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_ENCORE)
|
||||
{
|
||||
if (move->id == MOVE_STRUGGLE)
|
||||
{
|
||||
if (!(pokemon_info->moves.struggle_move_flags & MOVE_FLAG_LAST_USED))
|
||||
return FALSE;
|
||||
}
|
||||
else if (!(move->flags0 & MOVE_FLAG_LAST_USED))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
#include "dungeon_parameters.h"
|
||||
#include "dungeon_parameters_1.h"
|
||||
|
||||
const s16 CHATOT_SCARF_BOUNCE_CHANCE = 20;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#include "dungeon_parameters_2.h"
|
||||
|
||||
const enum type_id WEATHER_BALL_TYPE_TABLE[8] = {
|
||||
TYPE_NORMAL,
|
||||
TYPE_FIRE,
|
||||
TYPE_ROCK,
|
||||
TYPE_NORMAL,
|
||||
TYPE_WATER,
|
||||
TYPE_ICE,
|
||||
TYPE_NORMAL,
|
||||
TYPE_ICE
|
||||
TYPE_NORMAL, // WEATHER_CLEAR
|
||||
TYPE_FIRE, // WEATHER_SUNNY
|
||||
TYPE_ROCK, // WEATHER_SANDSTORM
|
||||
TYPE_NORMAL, // WEATHER_CLOUDY
|
||||
TYPE_WATER, // WEATHER_RAIN
|
||||
TYPE_ICE, // WEATHER_HAIL
|
||||
TYPE_NORMAL, // WEATHER_FOG
|
||||
TYPE_ICE // WEATHER_SNOW
|
||||
};
|
||||
|
|
|
|||
9
src/main_0201398C.c
Normal file
9
src/main_0201398C.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include "main_0201398C.h"
|
||||
#include "move_data.h"
|
||||
|
||||
extern struct move_data_table_outer DUNGEON_MOVE_TABLES;
|
||||
|
||||
s16 GetMoveAiWeight(struct move *move)
|
||||
{
|
||||
return DUNGEON_MOVE_TABLES.moves->moves[move->id].ai_weight;
|
||||
}
|
||||
16
src/overlay_29_022EBC50.c
Normal file
16
src/overlay_29_022EBC50.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "overlay_29_022EBC50.h"
|
||||
#include "dungeon_action.h"
|
||||
|
||||
void SetActionRegularAttack(struct action_data *monster_action, u8 direction)
|
||||
{
|
||||
SetMonsterActionFields(monster_action, ACTION_REGULAR_ATTACK);
|
||||
if (direction != DIR_NONE_UNSIGNED)
|
||||
monster_action->direction = direction & DIRECTION_MASK;
|
||||
}
|
||||
|
||||
void SetActionStruggle(struct action_data *monster_action, u8 direction)
|
||||
{
|
||||
SetMonsterActionFields(monster_action, ACTION_STRUGGLE);
|
||||
if (direction != DIR_NONE_UNSIGNED)
|
||||
monster_action->direction = direction & DIRECTION_MASK;
|
||||
}
|
||||
26
src/overlay_29_0230AB58.c
Normal file
26
src/overlay_29_0230AB58.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "overlay_29_0230AB58.h"
|
||||
#include "dungeon.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_util_static.h"
|
||||
|
||||
bool8 ScrappyShouldActivate(struct entity *attacker, struct entity *defender, enum type_id attack_type)
|
||||
{
|
||||
for (s16 i = 0; i < 2; i++)
|
||||
{
|
||||
bool8 scrappy_should_activate;
|
||||
struct monster *defender_monster = GetEntInfo(defender);
|
||||
if (AbilityIsActiveVeneer(attacker, ABILITY_SCRAPPY) &&
|
||||
defender_monster->types[i] == TYPE_GHOST &&
|
||||
(attack_type == TYPE_NORMAL || attack_type == TYPE_FIGHTING))
|
||||
scrappy_should_activate = TRUE;
|
||||
else
|
||||
scrappy_should_activate = FALSE;
|
||||
|
||||
if (scrappy_should_activate)
|
||||
{
|
||||
DUNGEON_PTR[0]->last_damage_calc.scrappy_activated = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
#include "overlay_29_0230F8AC.h"
|
||||
#include "dungeon_ai_items_1.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "exclusive_item.h"
|
||||
#include "overlay_29_0230F810.h"
|
||||
|
||||
bool8 ExclusiveItemEffectIsActive__0230F8AC(struct entity *entity, enum exclusive_item_effect_id effect_id)
|
||||
{
|
||||
|
|
@ -10,3 +14,28 @@ bool8 ExclusiveItemEffectIsActive__0230F8AC(struct entity *entity, enum exclusiv
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 FindDirectionOfAdjacentMonsterWithItem(struct entity *pokemon, enum item_id item_id)
|
||||
{
|
||||
if (!EntityIsValid__0230F008(pokemon))
|
||||
return DIR_NONE_UNSIGNED;
|
||||
|
||||
u8 i = 0;
|
||||
u8 direction = GetEntInfo(pokemon)->action.direction;
|
||||
for (; i < NUM_DIRECTIONS; i++, direction = (u8)(direction + 1) & DIRECTION_MASK)
|
||||
{
|
||||
struct entity *monster_in_direction = GetTile(pokemon->pos.x + DIRECTIONS_XY[direction].x, pokemon->pos.y + DIRECTIONS_XY[direction].y)->monster;
|
||||
if (monster_in_direction != NULL && IsMonster__0230F980(monster_in_direction) && ItemIsActive__0230F810(monster_in_direction, item_id))
|
||||
return direction;
|
||||
}
|
||||
|
||||
return DIR_NONE_UNSIGNED;
|
||||
}
|
||||
|
||||
bool8 IsMonster__0230F980(struct entity *entity)
|
||||
{
|
||||
if (entity == NULL)
|
||||
return FALSE;
|
||||
|
||||
return GetEntityType(entity) == ENTITY_MONSTER;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
#include "overlay_29_0230F980.h"
|
||||
#include "dungeon_util_static.h"
|
||||
|
||||
bool8 IsMonster__0230F980(struct entity *entity)
|
||||
{
|
||||
if (entity == NULL)
|
||||
return FALSE;
|
||||
|
||||
return GetEntityType(entity) == ENTITY_MONSTER;
|
||||
}
|
||||
36
src/overlay_29_02338350.c
Normal file
36
src/overlay_29_02338350.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include "overlay_29_02338350.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_util_static.h"
|
||||
|
||||
struct entity* FindAdjacentEnemy(struct entity *monster)
|
||||
{
|
||||
s16 i;
|
||||
bool8 is_not_team_member = FALSE;
|
||||
if (GetEntInfo(monster)->is_not_team_member)
|
||||
is_not_team_member = TRUE;
|
||||
|
||||
for (i = 0; i < NUM_DIRECTIONS; i++)
|
||||
{
|
||||
struct entity *monster_in_direction = GetTile(monster->pos.x + DIRECTIONS_XY[i].x, monster->pos.y + DIRECTIONS_XY[i].y)->monster;
|
||||
if (monster_in_direction != NULL && GetEntityType(monster_in_direction) == ENTITY_MONSTER)
|
||||
{
|
||||
bool8 monster_in_direction_not_team_member = GetEntInfo(monster_in_direction)->is_not_team_member;
|
||||
if (is_not_team_member)
|
||||
{
|
||||
if (!monster_in_direction_not_team_member)
|
||||
return monster_in_direction;
|
||||
}
|
||||
else if (monster_in_direction_not_team_member)
|
||||
return monster_in_direction;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool8 IsAdjacentToEnemyIgnoreTreatment(struct entity *monster)
|
||||
{
|
||||
if (FindAdjacentEnemy(monster) != NULL)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@
|
|||
#include "overlay_29_0230A994.h"
|
||||
#include "overlay_29_02318A4C.h"
|
||||
#include "overlay_29_02338390.h"
|
||||
|
||||
extern struct type_matchup_table TYPE_MATCHUP_TABLE;
|
||||
#include "type_matchup_table.h"
|
||||
|
||||
s16 GetTypeMatchup(struct entity *attacker, struct entity *defender, s16 target_type_idx, enum type_id attack_type)
|
||||
{
|
||||
|
|
|
|||
31
src/type_matchup_table.c
Normal file
31
src/type_matchup_table.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "type_matchup_table.h"
|
||||
|
||||
// Type chart
|
||||
#define IMMUNE MATCHUP_IMMUNE
|
||||
#define RESIST MATCHUP_NOT_VERY_EFFECTIVE
|
||||
#define NEUTRAL MATCHUP_NEUTRAL
|
||||
#define SUPER MATCHUP_SUPER_EFFECTIVE
|
||||
|
||||
const struct type_matchup_table TYPE_MATCHUP_TABLE = {
|
||||
{
|
||||
// NONE NORMAL FIRE WATER GRASS ELECTRIC ICE FIGHTING POISON GROUND FLYING PSYCHIC BUG ROCK GHOST DRAGON DARK STEEL
|
||||
[TYPE_NONE] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL},
|
||||
[TYPE_NORMAL] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
|
||||
[TYPE_FIRE] = {NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, NEUTRAL, SUPER},
|
||||
[TYPE_WATER] = {NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
|
||||
[TYPE_GRASS] = {NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST},
|
||||
[TYPE_ELECTRIC] = {NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
|
||||
[TYPE_ICE] = {NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
|
||||
[TYPE_FIGHTING] = {NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST, RESIST, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, SUPER},
|
||||
[TYPE_POISON] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, IMMUNE},
|
||||
[TYPE_GROUND] = {NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, IMMUNE, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER},
|
||||
[TYPE_FLYING] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
|
||||
[TYPE_PSYCHIC] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, RESIST},
|
||||
[TYPE_BUG] = {NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, RESIST},
|
||||
[TYPE_ROCK] = {NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
|
||||
[TYPE_GHOST] = {NEUTRAL, IMMUNE, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
|
||||
[TYPE_DRAGON] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
|
||||
[TYPE_DARK] = {NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
|
||||
[TYPE_STEEL] = {NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST}
|
||||
}
|
||||
};
|
||||
|
|
@ -11,11 +11,13 @@ parser = argparse.ArgumentParser()
|
|||
|
||||
parser.add_argument('asm_file')
|
||||
parser.add_argument('split_symbol_name')
|
||||
parser.add_argument('-f', '--split_file_name')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
symbol_location = args.asm_file
|
||||
symbol_name = args.split_symbol_name
|
||||
split_file_name = args.split_file_name
|
||||
|
||||
if symbol_location.endswith('.s'):
|
||||
symbol_location = symbol_location[:-2]
|
||||
|
|
@ -62,7 +64,10 @@ LSF_FILE_PATH = 'main.lsf'
|
|||
with open(LSF_FILE_PATH, 'r') as lsf_file:
|
||||
lsf_lines = lsf_file.readlines()
|
||||
|
||||
new_asm_base_name = f"{file_prefix}{data_type}_{new_symbol_address}"
|
||||
if split_file_name is None:
|
||||
new_asm_base_name = f"{file_prefix}{data_type}_{new_symbol_address}"
|
||||
else:
|
||||
new_asm_base_name = split_file_name
|
||||
|
||||
# If needed, add the extracted function's new .o file to main.lsf.
|
||||
merge_prev_file = None
|
||||
|
|
|
|||
|
|
@ -82,9 +82,9 @@ def read_xmap_symbols_for_language(language: str) -> Dict[str, Dict[int, SymbolD
|
|||
|
||||
elif current_section is not None and line.startswith(' ') and ('.text' in line or '.itcm' in line or line_is_data(line)) and len(line) > 28 and line[28] not in NON_FUNCTION_SYMBOLS:
|
||||
symbol_split = line[28:-1].split('\t')
|
||||
symbol_name = symbol_split[0]
|
||||
symbol_name: str = symbol_split[0]
|
||||
|
||||
if symbol_name in XMAP_SYMBOL_BLACKLIST or '$' in symbol_name:
|
||||
if symbol_name in XMAP_SYMBOL_BLACKLIST or '$' in symbol_name or symbol_name.startswith('@'):
|
||||
continue
|
||||
|
||||
symbol_address = int(line[2:10], 16)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user