summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2015-04-01 16:16:43 +0200
committerxCrystal <rgr.crystal@gmail.com>2015-04-01 17:05:49 +0200
commit77d0e5ff84cc61ae625da19f184094241eddd4dc (patch)
tree921ae74206ff3b396cc3423a0b699b4563239a96
parent46c2a38c7c55ff01e8787dfd624cb1c771248b6c (diff)
Rename battle files and split move effects Part 3
b.asm, b_2.asm, c.asm, and d.asm
-rw-r--r--[-rwxr-xr-x]engine/battle/display_effectiveness.asm (renamed from engine/battle/b.asm)0
-rw-r--r--[-rwxr-xr-x]engine/battle/link_battle_versus_text.asm (renamed from engine/battle/d.asm)0
-rw-r--r--engine/battle/moveEffects/mist_effect.asm21
-rw-r--r--[-rwxr-xr-x]engine/battle/moveEffects/one_hit_ko_effect.asm (renamed from engine/battle/c.asm)22
-rw-r--r--engine/battle/moveEffects/pay_day_effect.asm43
-rw-r--r--[-rwxr-xr-x]engine/battle/scale_sprites.asm (renamed from engine/battle/b_2.asm)44
-rwxr-xr-xmain.asm10
7 files changed, 70 insertions, 70 deletions
diff --git a/engine/battle/b.asm b/engine/battle/display_effectiveness.asm
index 17f0bd5b..17f0bd5b 100755..100644
--- a/engine/battle/b.asm
+++ b/engine/battle/display_effectiveness.asm
diff --git a/engine/battle/d.asm b/engine/battle/link_battle_versus_text.asm
index 7320da29..7320da29 100755..100644
--- a/engine/battle/d.asm
+++ b/engine/battle/link_battle_versus_text.asm
diff --git a/engine/battle/moveEffects/mist_effect.asm b/engine/battle/moveEffects/mist_effect.asm
new file mode 100644
index 00000000..adee1dfd
--- /dev/null
+++ b/engine/battle/moveEffects/mist_effect.asm
@@ -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 "@"
diff --git a/engine/battle/c.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm
index b7c20ef6..84418e33 100755..100644
--- a/engine/battle/c.asm
+++ b/engine/battle/moveEffects/one_hit_ko_effect.asm
@@ -1,25 +1,3 @@
-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 "@"
-
OneHitKOEffect_: ; 33f57 (c:7f57)
ld hl, W_DAMAGE
xor a
diff --git a/engine/battle/moveEffects/pay_day_effect.asm b/engine/battle/moveEffects/pay_day_effect.asm
new file mode 100644
index 00000000..75a005ed
--- /dev/null
+++ b/engine/battle/moveEffects/pay_day_effect.asm
@@ -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 "@"
diff --git a/engine/battle/b_2.asm b/engine/battle/scale_sprites.asm
index 4a49bb10..dae4ad42 100755..100644
--- a/engine/battle/b_2.asm
+++ b/engine/battle/scale_sprites.asm
@@ -83,47 +83,3 @@ DuplicateBitsTable: ; 2fea8 (b:7ea8)
db $30, $33, $3c, $3f
db $c0, $c3, $cc, $cf
db $f0, $f3, $fc, $ff
-
-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 "@"
diff --git a/main.asm b/main.asm
index 1c7f15f9..838c4c39 100755
--- a/main.asm
+++ b/main.asm
@@ -5307,7 +5307,7 @@ FossilKabutopsPic:: INCBIN "pic/bmon/fossilkabutops.pic"
SECTION "Battle (bank B)", ROMX, BANK[$B]
-INCLUDE "engine/battle/b.asm"
+INCLUDE "engine/battle/display_effectiveness.asm"
TrainerInfoTextBoxTileGraphics: INCBIN "gfx/trainer_info.2bpp"
BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp"
@@ -5315,7 +5315,8 @@ CircleTile: INCBIN "gfx/circle_tile.2bpp"
BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp"
INCLUDE "engine/items/tmhm.asm"
-INCLUDE "engine/battle/b_2.asm"
+INCLUDE "engine/battle/scale_sprites.asm"
+INCLUDE "engine/battle/moveEffects/pay_day_effect.asm"
INCLUDE "engine/game_corner_slots2.asm"
@@ -5385,7 +5386,8 @@ OldManPic:: INCBIN "pic/trainer/oldman.pic"
SECTION "Battle (bank C)", ROMX, BANK[$C]
-INCLUDE "engine/battle/c.asm"
+INCLUDE "engine/battle/moveEffects/mist_effect.asm"
+INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm"
SECTION "Pics 5", ROMX, BANK[PICS_5]
@@ -5449,7 +5451,7 @@ VictreebelPicBack:: INCBIN "pic/monback/victreebelb.pic"
SECTION "Battle (bank D)", ROMX, BANK[$D]
INCLUDE "engine/titlescreen2.asm"
-INCLUDE "engine/battle/d.asm"
+INCLUDE "engine/battle/link_battle_versus_text.asm"
INCLUDE "engine/slot_machine.asm"
INCLUDE "engine/overworld/pewter_guys.asm"
INCLUDE "engine/multiply_divide.asm"