mirror of
https://github.com/pret/pokered.git
synced 2024-10-22 22:55:31 +00:00
Rename battle files and split move effects Part 2
5.asm, 9.asm, and a.asm
This commit is contained in:
parent
e74dce24b4
commit
46c2a38c7c
7 changed files with 84 additions and 84 deletions
|
@ -8369,8 +8369,8 @@ ParalyzeEffect: ; 3f9b1 (f:79b1)
|
|||
jp Bankswitch
|
||||
|
||||
SubstituteEffect: ; 3f9b9 (f:79b9)
|
||||
ld hl, SubstituteEffectHandler
|
||||
ld b, BANK(SubstituteEffectHandler)
|
||||
ld hl, SubstituteEffect_
|
||||
ld b, BANK(SubstituteEffect_)
|
||||
jp Bankswitch
|
||||
|
||||
HyperBeamEffect: ; 3f9c1 (f:79c1)
|
||||
|
|
24
engine/battle/moveEffects/focus_energy_effect.asm
Normal file
24
engine/battle/moveEffects/focus_energy_effect.asm
Normal file
|
@ -0,0 +1,24 @@
|
|||
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
||||
ld hl, W_PLAYERBATTSTATUS2
|
||||
ld a, [H_WHOSETURN]
|
||||
and a
|
||||
jr z, .notEnemy
|
||||
ld hl, W_ENEMYBATTSTATUS2
|
||||
.notEnemy
|
||||
bit GettingPumped, [hl] ; is mon already using focus energy?
|
||||
jr nz, .alreadyUsing
|
||||
set GettingPumped, [hl] ; mon is now using focus energy
|
||||
callab PlayCurrentMoveAnimation
|
||||
ld hl, GettingPumpedText
|
||||
jp PrintText
|
||||
.alreadyUsing
|
||||
ld c, $32
|
||||
call DelayFrames
|
||||
ld hl, PrintButItFailedText_
|
||||
ld b, BANK(PrintButItFailedText_)
|
||||
jp Bankswitch
|
||||
|
||||
GettingPumpedText: ; 27fb3 (9:7fb3)
|
||||
db $0a
|
||||
TX_FAR _GettingPumpedText
|
||||
db "@"
|
0
engine/battle/a.asm → engine/battle/moveEffects/leech_seed_effect.asm
Executable file → Normal file
0
engine/battle/a.asm → engine/battle/moveEffects/leech_seed_effect.asm
Executable file → Normal file
2
engine/battle/5.asm → engine/battle/moveEffects/substitute_effect.asm
Executable file → Normal file
2
engine/battle/5.asm → engine/battle/moveEffects/substitute_effect.asm
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||
SubstituteEffect_: ; 17dad (5:7dad)
|
||||
ld c, 50
|
||||
call DelayFrames
|
||||
ld hl, wBattleMonMaxHP
|
52
engine/battle/print_type.asm
Normal file
52
engine/battle/print_type.asm
Normal file
|
@ -0,0 +1,52 @@
|
|||
; [wd0b5] = pokemon ID
|
||||
; hl = dest addr
|
||||
PrintMonType: ; 27d6b (9:7d6b)
|
||||
call GetPredefRegisters
|
||||
push hl
|
||||
call GetMonHeader
|
||||
pop hl
|
||||
push hl
|
||||
ld a, [W_MONHTYPE1]
|
||||
call PrintType
|
||||
ld a, [W_MONHTYPE1]
|
||||
ld b, a
|
||||
ld a, [W_MONHTYPE2]
|
||||
cp b
|
||||
pop hl
|
||||
jr z, EraseType2Text
|
||||
ld bc, SCREEN_WIDTH * 2
|
||||
add hl, bc
|
||||
|
||||
; a = type
|
||||
; hl = dest addr
|
||||
PrintType: ; 27d89 (9:7d89)
|
||||
push hl
|
||||
jr PrintType_
|
||||
|
||||
; erase "TYPE2/" if the mon only has 1 type
|
||||
EraseType2Text: ; 27d8c (9:7d8c)
|
||||
ld a, " "
|
||||
ld bc, $13
|
||||
add hl, bc
|
||||
ld bc, $6
|
||||
jp FillMemory
|
||||
|
||||
PrintMoveType: ; 27d98 (9:7d98)
|
||||
call GetPredefRegisters
|
||||
push hl
|
||||
ld a, [W_PLAYERMOVETYPE]
|
||||
; fall through
|
||||
|
||||
PrintType_: ; 27d9f (9:7d9f)
|
||||
add a
|
||||
ld hl, TypeNames
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld d, [hl]
|
||||
pop hl
|
||||
jp PlaceString
|
||||
|
||||
INCLUDE "text/type_names.asm"
|
78
engine/battle/9.asm → engine/battle/save_trainer_name.asm
Executable file → Normal file
78
engine/battle/9.asm → engine/battle/save_trainer_name.asm
Executable file → Normal file
|
@ -1,56 +1,3 @@
|
|||
; [wd0b5] = pokemon ID
|
||||
; hl = dest addr
|
||||
PrintMonType: ; 27d6b (9:7d6b)
|
||||
call GetPredefRegisters
|
||||
push hl
|
||||
call GetMonHeader
|
||||
pop hl
|
||||
push hl
|
||||
ld a, [W_MONHTYPE1]
|
||||
call PrintType
|
||||
ld a, [W_MONHTYPE1]
|
||||
ld b, a
|
||||
ld a, [W_MONHTYPE2]
|
||||
cp b
|
||||
pop hl
|
||||
jr z, EraseType2Text
|
||||
ld bc, SCREEN_WIDTH * 2
|
||||
add hl, bc
|
||||
|
||||
; a = type
|
||||
; hl = dest addr
|
||||
PrintType: ; 27d89 (9:7d89)
|
||||
push hl
|
||||
jr PrintType_
|
||||
|
||||
; erase "TYPE2/" if the mon only has 1 type
|
||||
EraseType2Text: ; 27d8c (9:7d8c)
|
||||
ld a, " "
|
||||
ld bc, $13
|
||||
add hl, bc
|
||||
ld bc, $6
|
||||
jp FillMemory
|
||||
|
||||
PrintMoveType: ; 27d98 (9:7d98)
|
||||
call GetPredefRegisters
|
||||
push hl
|
||||
ld a, [W_PLAYERMOVETYPE]
|
||||
; fall through
|
||||
|
||||
PrintType_: ; 27d9f (9:7d9f)
|
||||
add a
|
||||
ld hl, TypeNames
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld d, [hl]
|
||||
pop hl
|
||||
jp PlaceString
|
||||
|
||||
INCLUDE "text/type_names.asm"
|
||||
|
||||
SaveTrainerName: ; 27e4a (9:7e4a)
|
||||
ld hl,TrainerNamePointers
|
||||
ld a,[W_TRAINERCLASS]
|
||||
|
@ -163,28 +110,3 @@ CooltrainerMName: ; 27f6c (9:7f6c)
|
|||
db "COOLTRAINER♂@"
|
||||
CooltrainerFName: ; 27f79 (9:7f79)
|
||||
db "COOLTRAINER♀@"
|
||||
|
||||
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
||||
ld hl, W_PLAYERBATTSTATUS2
|
||||
ld a, [H_WHOSETURN]
|
||||
and a
|
||||
jr z, .notEnemy
|
||||
ld hl, W_ENEMYBATTSTATUS2
|
||||
.notEnemy
|
||||
bit GettingPumped, [hl] ; is mon already using focus energy?
|
||||
jr nz, .alreadyUsing
|
||||
set GettingPumped, [hl] ; mon is now using focus energy
|
||||
callab PlayCurrentMoveAnimation
|
||||
ld hl, GettingPumpedText
|
||||
jp PrintText
|
||||
.alreadyUsing
|
||||
ld c, $32
|
||||
call DelayFrames
|
||||
ld hl, PrintButItFailedText_
|
||||
ld b, BANK(PrintButItFailedText_)
|
||||
jp Bankswitch
|
||||
|
||||
GettingPumpedText: ; 27fb3 (9:7fb3)
|
||||
db $0a
|
||||
TX_FAR _GettingPumpedText
|
||||
db "@"
|
8
main.asm
8
main.asm
|
@ -4825,7 +4825,7 @@ INCLUDE "engine/load_pokedex_tiles.asm"
|
|||
INCLUDE "engine/overworld/map_sprites.asm"
|
||||
INCLUDE "engine/overworld/emotion_bubbles.asm"
|
||||
INCLUDE "engine/evolve_trade.asm"
|
||||
INCLUDE "engine/battle/5.asm"
|
||||
INCLUDE "engine/battle/moveEffects/substitute_effect.asm"
|
||||
INCLUDE "engine/menu/pc.asm"
|
||||
|
||||
|
||||
|
@ -5154,7 +5154,9 @@ TangelaPicBack:: INCBIN "pic/monback/tangelab.pic"
|
|||
|
||||
|
||||
SECTION "Battle (bank 9)", ROMX, BANK[$9]
|
||||
INCLUDE "engine/battle/9.asm"
|
||||
INCLUDE "engine/battle/print_type.asm"
|
||||
INCLUDE "engine/battle/save_trainer_name.asm"
|
||||
INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm"
|
||||
|
||||
|
||||
SECTION "Pics 2", ROMX, BANK[PICS_2]
|
||||
|
@ -5226,7 +5228,7 @@ MoltresPicBack:: INCBIN "pic/monback/moltresb.pic"
|
|||
|
||||
|
||||
SECTION "Battle (bank A)", ROMX, BANK[$A]
|
||||
INCLUDE "engine/battle/a.asm"
|
||||
INCLUDE "engine/battle/moveEffects/leech_seed_effect.asm"
|
||||
|
||||
|
||||
SECTION "Pics 3", ROMX, BANK[PICS_3]
|
||||
|
|
Loading…
Reference in a new issue