Still more battle command labels

This commit is contained in:
PikalaxALT 2015-11-06 22:36:06 -05:00
parent d8aa438644
commit 929d0aa081
10 changed files with 351 additions and 344 deletions

View File

@ -1158,7 +1158,7 @@ ResidualDamage: ; 3c716
call SubtractHPFromUser
ld a, $1
ld [hBGMapMode], a
call Function3ccef
call RestoreHP
ld hl, LeechSeedSapsText
call StdBattleTextBox
.asm_3c7a1
@ -1394,7 +1394,7 @@ Function3c8eb: ; 3c8eb
.asm_3c92d
call GetSixteenthMaxHP
call SwitchTurnCore
call Function3ccef
call RestoreHP
ld hl, BattleText_0x80880
jp StdBattleTextBox
; 3c93c
@ -1531,7 +1531,7 @@ Function3c93c: ; 3c93c
.asm_3ca14
call GetItemName
call SwitchTurnCore
call Function3ddc8
call ItemRecoveryAnim
call SwitchTurnCore
ld hl, BattleText_UserRecoveredPPUsing
jp StdBattleTextBox
@ -2032,7 +2032,7 @@ Function3ccde: ; 3ccde
; 3ccef
Function3ccef: ; 3ccef
RestoreHP ; 3ccef
ld hl, EnemyMonMaxHP
ld a, [hBattleTurn]
and a
@ -4461,21 +4461,21 @@ Function3dcf9: ; 3dcf9
jr z, .player_1
call SetPlayerTurn
call Function3dd2f
call Function3dde9
call UseHeldStatusHealingItem
call Function3de51
call SetEnemyTurn
call Function3dd2f
call Function3dde9
call UseHeldStatusHealingItem
jp Function3de51
.player_1
call SetEnemyTurn
call Function3dd2f
call Function3dde9
call UseHeldStatusHealingItem
call Function3de51
call SetPlayerTurn
call Function3dd2f
call Function3dde9
call UseHeldStatusHealingItem
jp Function3de51
; 3dd2f
@ -4519,7 +4519,7 @@ Function3dd2f: ; 3dd2f
ret nc
.asm_3dd66
call Function3ddc8
call ItemRecoveryAnim
ld a, [hli]
ld [Buffer2], a
ld a, [hl]
@ -4559,7 +4559,7 @@ Function3dd2f: ; 3dd2f
.asm_3dda4
ld [wd10a], a
predef Functionc6e0
Function3ddac:
UseOpponentItem:
call RefreshBattleHuds
callab GetOpponentItem
ld a, [hl]
@ -4571,7 +4571,7 @@ Function3ddac:
; 3ddc8
Function3ddc8: ; 3ddc8
ItemRecoveryAnim: ; 3ddc8
push hl
push de
push bc
@ -4590,16 +4590,16 @@ Function3ddc8: ; 3ddc8
ret
; 3dde9
Function3dde9: ; 3dde9
UseHeldStatusHealingItem: ; 3dde9
callab GetOpponentItem
ld hl, .Statuses
.asm_3ddf2
.loop
ld a, [hli]
cp $ff
ret z
inc hl
cp b
jr nz, .asm_3ddf2
jr nz, .loop
dec hl
ld b, [hl]
ld a, BATTLE_VARS_STATUS_OPP
@ -4620,26 +4620,26 @@ Function3dde9: ; 3dde9
and [hl]
res SUBSTATUS_NIGHTMARE, [hl]
ld a, b
cp $7f
jr nz, .asm_3de26
cp 1 << PSN | 1 << FRZ | 1 << BRN | SLP | 1 << PAR
jr nz, .skip_confuse
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
.asm_3de26
.skip_confuse
ld hl, CalcEnemyStats
ld a, [hBattleTurn]
and a
jr z, .asm_3de31
jr z, .got_pointer
ld hl, CalcPlayerStats
.asm_3de31
.got_pointer
call SwitchTurnCore
ld a, BANK(CalcEnemyStats)
rst FarCall
call SwitchTurnCore
call Function3ddc8
call Function3ddac
call ItemRecoveryAnim
call UseOpponentItem
ld a, $1
and a
ret
@ -4675,7 +4675,7 @@ Function3de51: ; 3de51
call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
call GetItemName
call Function3ddc8
call ItemRecoveryAnim
ld hl, BattleText_0x80dab
call StdBattleTextBox
ld a, [hBattleTurn]

View File

@ -166,8 +166,8 @@ BattleCommandPointers: ; 3fd28
dw BattleCommanda3 ; 34833
dw BattleCommand_AllStatsUp ; 36500
dw BattleCommanda5 ; 35165
dw BattleCommanda6 ; 365af
dw BattleCommanda7 ; 365c3
dw BattleCommand_RaiseSubNoAnim ; 365af
dw BattleCommand_LowerSubNoAnim ; 365c3
dw BattleCommanda8 ; 355b5
dw BattleCommand_ClearMissDamage ; 355d5 - a9
dw BattleCommand_MoveDelay ; 37e80

File diff suppressed because it is too large Load Diff

79
battle/effects/attract.asm Executable file
View File

@ -0,0 +1,79 @@
BattleCommand_Attract: ; 377ce
; attract
ld a, [AttackMissed]
and a
jr nz, .failed
call CheckOppositeGender
jr c, .failed
call CheckHiddenOpponent
jr nz, .failed
ld a, BATTLE_VARS_SUBSTATUS1_OPP
call GetBattleVarAddr
bit SUBSTATUS_IN_LOVE, [hl]
jr nz, .failed
set SUBSTATUS_IN_LOVE, [hl]
call AnimateCurrentMove
; 'fell in love!'
ld hl, FellInLoveText
jp StdBattleTextBox
.failed
jp Function37354
; 377f5
CheckOppositeGender: ; 377f5
ld a, MON_SPECIES
call BattlePartyAttr
ld a, [hl]
ld [CurPartySpecies], a
ld a, [CurBattleMon]
ld [CurPartyMon], a
xor a
ld [MonType], a
callba GetGender
jr c, .genderless_samegender
ld b, 1
jr nz, .got_gender
dec b
.got_gender
push bc
ld a, [TempEnemyMonSpecies]
ld [CurPartySpecies], a
ld hl, EnemyMonDVs
ld a, [EnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .not_transformed
ld hl, wEnemyBackupDVs
.not_transformed
ld a, [hli]
ld [TempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
ld a, 3
ld [MonType], a
callba GetGender
pop bc
jr c, .genderless_samegender
ld a, 1
jr nz, .got_enemy_gender
dec a
.got_enemy_gender
xor b
jr z, .genderless_samegender
and a
ret
.genderless_samegender
scf
ret
; 3784b

93
battle/effects/present.asm Executable file
View File

@ -0,0 +1,93 @@
BattleCommand_Present: ; 37874
; present
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .colosseum_skippush
push bc
push de
.colosseum_skippush
call BattleCommand_Stab
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .colosseum_skippop
pop de
pop bc
.colosseum_skippop
ld a, [wTypeMatchup]
and a
jp z, AnimateFailedMove
ld a, [AttackMissed]
and a
jp nz, AnimateFailedMove
push bc
call BattleRandom
ld b, a
ld hl, .PresentPower
ld c, 0
.next
ld a, [hli]
cp $ff
jr z, .heal_effect ; 378a4 $11
cp b
jr nc, .got_power ; 378a7 $4
inc c
inc hl
jr .next ; 378ab $f4
.got_power
ld a, c
ld [wPresentPower], a
call AnimateCurrentMoveEitherSide
ld d, [hl]
pop bc
ret
.heal_effect
pop bc
ld a, $3
ld [wPresentPower], a
call AnimateCurrentMove
call BattleCommand_SwitchTurn
ld hl, AICheckPlayerMaxHP
ld a, [hBattleTurn]
and a
jr z, .got_hp_fn_pointer ; 378c9 $3
ld hl, AICheckEnemyMaxHP
.got_hp_fn_pointer
ld a, BANK(AICheckPlayerMaxHP)
rst FarCall
jr c, .already_fully_healed ; 378d1 $20
ld hl, GetQuarterMaxHP
call CallBattleCore
call BattleCommand_SwitchTurn
ld hl, RestoreHP
call CallBattleCore
call BattleCommand_SwitchTurn
ld hl, RegainedHealthText
call StdBattleTextBox
call BattleCommand_SwitchTurn
call UpdateOpponentInParty
jr .do_animation ; 378f1 $11
.already_fully_healed
call BattleCommand_SwitchTurn
call _CheckBattleScene
jr nc, .do_animation ; 378f9 $9
call AnimateFailedMove
ld hl, RefusedGiftText
call StdBattleTextBox
.do_animation
jp EndMoveEffect
.PresentPower
db 40 percent, 40
db 70 percent + 1, 80
db 80 percent, 120
db $ff
; 3790e

View File

@ -13,11 +13,11 @@ Functionfbd54: ; fbd54
jr Functionfbd91
Functionfbd69: ; fbd69 (3e:7d69)
callba BattleCommanda6
callba BattleCommand_RaiseSubNoAnim
jr Functionfbd77
Functionfbd71: ; fbd71 (3e:7d71)
callba BattleCommanda7
callba BattleCommand_LowerSubNoAnim
Functionfbd77: ; fbd77 (3e:7d77)
xor a

View File

@ -331,7 +331,7 @@ EvasionUp:
lowersub
evasionup
statupanim
effect0xa7
lowersubnoanim
raisesub
statupmessage
statupfailtext

View File

@ -170,8 +170,8 @@ endm
command effect0xa3
command allstatsup
command effect0xa5
command effect0xa6
command effect0xa7
command raisesubnoanim
command lowersubnoanim
command effect0xa8
command clearmissdamage
command movedelay

View File

@ -31025,7 +31025,7 @@ AI_Redundant: ; 2c41a
jr .NotRedundant
.Attract: ; 2c4fe
callba Function377f5
callba CheckOppositeGender
jr c, .Redundant
ld a, [PlayerSubStatus1]
bit SUBSTATUS_IN_LOVE, a

View File

@ -66,6 +66,7 @@ battle_struct: MACRO
\1Type::
\1Type1:: db
\1Type2:: db
\1StructEnd::
ENDM
box: MACRO
@ -600,7 +601,8 @@ EnemyDamageTaken:: ; c684
wc686:: ds 2
wc688:: ds 1
wKickCounter:: ds 1
wKickCounter::
wPresentPower:: ds 1
wc68a::
BattleScriptBuffer:: ; c68a
ds 40
@ -703,6 +705,7 @@ wPayDayMoney:: ds 3 ; c6ec
ds 1
wc6f0:: ds 2
wEnemyBackupDVs:: ; used when enemy is transformed
wc6f2:: ds 2
AlreadyDisobeyed:: ; c6f4
ds 1