Rename battle files and split move effects Part 3

b.asm, b_2.asm, c.asm, and d.asm
This commit is contained in:
xCrystal 2015-04-01 16:16:43 +02:00
parent 46c2a38c7c
commit 77d0e5ff84
7 changed files with 70 additions and 70 deletions

View file

@ -0,0 +1,21 @@
MistEffect_: ; 33f2b (c:7f2b)
ld hl, W_PLAYERBATTSTATUS2
ld a, [$fff3]
and a
jr z, .asm_33f36
ld hl, W_ENEMYBATTSTATUS2
.asm_33f36
bit ProtectedByMist, [hl] ; is mon protected by mist?
jr nz, .asm_33f4a
set ProtectedByMist, [hl] ; mon is now protected by mist
callab PlayCurrentMoveAnimation
ld hl, ShroudedInMistText
jp PrintText
.asm_33f4a
ld hl, PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
ShroudedInMistText: ; 33f52 (c:7f52)
TX_FAR _ShroudedInMistText
db "@"

View file

@ -0,0 +1,36 @@
OneHitKOEffect_: ; 33f57 (c:7f57)
ld hl, W_DAMAGE
xor a
ld [hli], a
ld [hl], a ; set the damage output to zero
dec a
ld [wCriticalHitOrOHKO], a
ld hl, wBattleMonSpeed + 1
ld de, wEnemyMonSpeed + 1
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_33f72
ld hl, wEnemyMonSpeed + 1
ld de, wBattleMonSpeed + 1
.asm_33f72
ld a, [de]
dec de
ld b, a
ld a, [hld]
sub b
ld a, [de]
ld b, a
ld a, [hl]
sbc b
jr c, .asm_33f8a
ld hl, W_DAMAGE
ld a, $ff
ld [hli], a
ld [hl], a
ld a, $2
ld [wCriticalHitOrOHKO], a
ret
.asm_33f8a
ld a, $1
ld [W_MOVEMISSED], a
ret

View file

@ -0,0 +1,43 @@
PayDayEffect_ ; 2feb8 (b:7eb8)
xor a
ld hl, wcd6d
ld [hli], a
ld a, [H_WHOSETURN]
and a
ld a, [wBattleMonLevel]
jr z, .asm_2fec8
ld a, [wEnemyMonLevel]
.asm_2fec8
add a
ld [H_DIVIDEND + 3], a
xor a
ld [H_DIVIDEND], a
ld [H_DIVIDEND + 1], a
ld [H_DIVIDEND + 2], a
ld a, $64
ld [H_DIVISOR], a
ld b, $4
call Divide
ld a, [H_QUOTIENT + 3]
ld [hli], a
ld a, [H_REMAINDER]
ld [H_DIVIDEND + 3], a
ld a, $a
ld [H_DIVISOR], a
ld b, $4
call Divide
ld a, [H_QUOTIENT + 3]
swap a
ld b, a
ld a, [H_REMAINDER]
add b
ld [hl], a
ld de, wTotalPayDayMoney + 2
ld c, $3
predef AddBCDPredef
ld hl, CoinsScatteredText
jp PrintText
CoinsScatteredText: ; 2ff04 (b:7f04)
TX_FAR _CoinsScatteredText
db "@"