aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-09-10 06:31:11 +0200
committerGitHub <noreply@github.com>2025-09-10 00:31:11 -0400
commitd237b01cfb241f417567c964e0df0658cf921570 (patch)
tree799e92e48259443aa6cf4c553ed7adf38bd442d4 /engine/battle
parentMerge branch 'master' of https://github.com/pret/pokered (diff)
downloadpokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.gz
pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.xz
pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.zip
Misc. naming and cleanup (#139)
* Name some printer/diploma routines * Name `wd434` * Name `NAME_LENGTH_JP` * Rename `callabd`/`calladb` to `farcall`/`callfar`
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/core.asm26
-rw-r--r--engine/battle/experience.asm2
-rw-r--r--engine/battle/init_battle.asm2
-rw-r--r--engine/battle/move_effects/substitute.asm2
-rw-r--r--engine/battle/scale_sprites.asm2
5 files changed, 17 insertions, 17 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index ca5dcec9..299b5ee7 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1053,7 +1053,7 @@ RemoveFaintedPlayerMon:
ld a, [wPlayerMonNumber]
ld [wWhichPokemon], a
- callfar IsThisPartymonStarterPikachu_Party
+ callfar IsThisPartyMonStarterPikachu
jr nc, .notPlayerPikachu
ldpikacry e, PikachuCry4
callfar PlayPikachuSoundClip
@@ -1076,10 +1076,10 @@ RemoveFaintedPlayerMon:
cp 30 ; is the enemy 30 levels greater than us?
jr nc, .carelessTrainer ; if so, punish the player for being careless, as they shouldn't be fighting a very high leveled trainer with such a level difference
.regularFaint
- callabd_ModifyPikachuHappiness PIKAHAPPY_FAINTED
+ farcall_ModifyPikachuHappiness PIKAHAPPY_FAINTED
ret
.carelessTrainer
- callabd_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER
+ farcall_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER
ret
PlayerMonFaintedText:
@@ -1794,7 +1794,7 @@ SendOutMon:
call RunPaletteCommand
ld hl, wEnemyBattleStatus1
res USING_TRAPPING_MOVE, [hl]
- callfar IsThisPartymonStarterPikachu
+ callfar IsThisPartyMonStarterPikachu
jr c, .starterPikachu
ld a, $1
ldh [hWhoseTurn], a
@@ -1829,7 +1829,7 @@ AnimateRetreatingPlayerMon:
push af
ld a, [wPlayerMonNumber]
ld [wWhichPokemon], a
- callfar IsThisPartymonStarterPikachu
+ callfar IsThisPartyMonStarterPikachu
pop bc
ld a, b
ld [wWhichPokemon], a
@@ -4331,7 +4331,7 @@ IgnoredOrdersText:
GetDamageVarsForPlayerAttack:
xor a
ld hl, wDamage ; damage to eventually inflict, initialise to zero
- ldi [hl], a
+ ld [hli], a
ld [hl], a
ld hl, wPlayerMovePower
ld a, [hli]
@@ -4637,8 +4637,8 @@ CalculateDamage:
xor a
ld hl, hDividend
- ldi [hl], a
- ldi [hl], a
+ ld [hli], a
+ ld [hli], a
ld [hl], a
; Multiply level by 2
@@ -4651,11 +4651,11 @@ CalculateDamage:
pop af
.nc
inc hl
- ldi [hl], a
+ ld [hli], a
; Divide by 5
ld a, 5
- ldd [hl], a
+ ld [hld], a
push bc
ld b, 4
call Divide
@@ -4894,7 +4894,7 @@ HandleCounterMove:
; if it did damage, double it
ld a, [hl]
add a
- ldd [hl], a
+ ld [hld], a
ld a, [hl]
adc a
ld [hl], a
@@ -5245,7 +5245,7 @@ HandleBuildingRage:
call StatModifierUpEffect ; stat modifier raising function
pop hl
xor a
- ldd [hl], a ; null move effect
+ ld [hld], a ; null move effect
ld a, RAGE
ld [hl], a ; restore the target pokemon's move number to Rage
ldh a, [hWhoseTurn]
@@ -6561,7 +6561,7 @@ LoadPlayerBackPic:
jr nz, .loop
ld de, vBackPic
call InterlaceMergeSpriteBuffers
- ld a, $0
+ ld a, BANK("Sprite Buffers")
call OpenSRAM
ld hl, vSprites
ld de, sSpriteBuffer1
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index 35f9f1a4..32afc017 100644
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -245,7 +245,7 @@ GainExperience:
call CallBattleCore
call SaveScreenTilesToBuffer1
.printGrewLevelText
- callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
+ farcall_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
ld hl, GrewLevelText
call PrintText
xor a ; PLAYER_PARTY_DATA
diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm
index 629ae7b0..27b5245b 100644
--- a/engine/battle/init_battle.asm
+++ b/engine/battle/init_battle.asm
@@ -54,7 +54,7 @@ InitBattleCommon:
ld a, [wLoneAttackNo]
and a
jp z, _InitBattleCommon
- callabd_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d
+ farcall_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d
jp _InitBattleCommon
InitWildBattle:
diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm
index b1fd8ac2..e4311209 100644
--- a/engine/battle/move_effects/substitute.asm
+++ b/engine/battle/move_effects/substitute.asm
@@ -39,7 +39,7 @@ SubstituteEffect_:
jr c, .notEnoughHP ; underflow means user would be left with negative health
; bug: since it only branches on carry, it will possibly leave user with 0 HP
.userHasZeroOrMoreHP
- ldi [hl], a ; save resulting HP after subtraction into current HP
+ ld [hli], a ; save resulting HP after subtraction into current HP
ld [hl], d
ld h, b
ld l, c
diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm
index eedd2e1d..4666f696 100644
--- a/engine/battle/scale_sprites.asm
+++ b/engine/battle/scale_sprites.asm
@@ -2,7 +2,7 @@
; assumes that input sprite chunks are 4x4 tiles, and the rightmost and bottommost 4 pixels will be ignored
; resulting in a 7*7 tile output sprite chunk
ScaleSpriteByTwo:
- ld a, $0
+ ld a, BANK("Sprite Buffers")
call OpenSRAM
call .ScaleSpriteByTwo
call CloseSRAM