aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
committerdannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
commit6cb885a9f68b9f445d7fa45279731336fe0247d4 (patch)
tree39736ab1dd8ebcc57f8e981db6103285743d5530 /engine/battle
parentIdentify unnamed functions in map_sprites.asm (#126) (diff)
parentFix some label typos, and add some constants instead of raw numbers (#492) (diff)
downloadpokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.gz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.xz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/animations.asm49
-rw-r--r--engine/battle/battle_transitions.asm8
-rw-r--r--engine/battle/core.asm16
-rw-r--r--engine/battle/effects.asm4
-rw-r--r--engine/battle/ghost_marowak_anim.asm6
-rw-r--r--engine/battle/trainer_ai.asm4
6 files changed, 43 insertions, 44 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 33036d05..08399ad4 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -274,7 +274,7 @@ PlayAnimation:
push af
ld a, [wAnimPalette]
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
call LoadMoveAnimationTiles
call LoadSubanimation
call PlaySubanimation
@@ -282,7 +282,7 @@ PlayAnimation:
vc_hook Stop_reducing_move_anim_flashing_Thunderbolt
ldh [rOBP0], a
vc_hook Stop_reducing_move_anim_flashing_Explosion
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
.nextAnimationCommand
vc_hook Stop_reducing_move_anim_flashing_Guillotine
pop hl
@@ -583,8 +583,8 @@ SetAnimationPalette:
ld a, $6c
vc_hook Reduce_move_anim_flashing_Haze
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
.notSGB
ld a, $e4
@@ -592,8 +592,8 @@ SetAnimationPalette:
ldh [rOBP0], a
ld a, $6c
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
Func_78e98:
@@ -729,7 +729,7 @@ DoBallTossSpecialEffects:
ldh a, [rOBP0]
xor %00111100 ; complement colors 1 and 2
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
.skipFlashingEffect
ld a, [wSubAnimCounter]
cp 11 ; is it the beginning of the subanimation?
@@ -1019,7 +1019,7 @@ AnimationFlashScreenLong:
cp 1
jr z, .endOfPalettes
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
call FlashScreenLongDelay
jr .innerLoop
.endOfPalettes
@@ -1082,17 +1082,17 @@ AnimationFlashScreen:
push af ; save initial palette
ld a, %00011011 ; 0, 1, 2, 3 (inverted colors)
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
xor a ; white out background
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
pop af
ldh [rBGP], a ; restore initial palette
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
AnimationDarkScreenPalette:
@@ -1138,7 +1138,7 @@ SetAnimationBGPalette:
ld a, c
.next
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
ld b, $5
@@ -2019,7 +2019,7 @@ AnimationSubstitute:
; Changes the pokemon's sprite to the mini sprite
ld hl, wTempPic
xor a
- ld bc, $310
+ ld bc, 7 * 7 tiles
call FillMemory
ldh a, [hWhoseTurn]
and a
@@ -2282,7 +2282,7 @@ GetMonSpriteTileMapPointerFromRowCount:
ldh a, [hWhoseTurn]
and a
jr nz, .enemyTurn
- ld a, 20 * 5 + 1
+ ld a, 5 * SCREEN_WIDTH + 1
jr .next
.enemyTurn
ld a, 12
@@ -2295,7 +2295,7 @@ GetMonSpriteTileMapPointerFromRowCount:
sub b
and a
jr z, .done
- ld de, 20
+ ld de, SCREEN_WIDTH
.loop
add hl, de
dec a
@@ -2349,8 +2349,7 @@ AnimCopyRowRight:
jr nz, AnimCopyRowRight
ret
-; get the sound of the move id in b
-GetMoveSoundB:
+GetIntroMoveSound: ; unreferenced
ld a, b
call GetMoveSound
ld b, a
@@ -2456,7 +2455,7 @@ CopyTileIDs:
dec c
jr nz, .columnLoop
pop hl
- ld bc, 20
+ ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
@@ -2473,7 +2472,7 @@ AnimationLeavesFalling:
; in Razor Leaf's animation.
ld a, [wAnimPalette]
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld d, $37 ; leaf tile
ld a, 3 ; number of leaves
ld [wNumFallingObjects], a
@@ -2678,12 +2677,12 @@ AnimationShakeEnemyHUD:
call BattleAnimCopyTileMapToVRAM
; update BGMap attributes
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
ld c, 13
farcall LoadBGMapAttributes
-.notGBC
+.notCGB
; Move the window so that the row below the enemy HUD (in BG map 0) lines up
; with the top row of the window on the screen. This makes it so that the window
@@ -2719,12 +2718,12 @@ AnimationShakeEnemyHUD:
ld hl, vBGMap1
call BattleAnimCopyTileMapToVRAM
; update BGMap attributes
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC2
+ jr z, .notCGB2
ld c, 11
farcall LoadBGMapAttributes
-.notGBC2
+.notCGB2
xor a
ldh [hWY], a
call SaveScreenTilesToBuffer1
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index b16bcdc1..8a340bf7 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -171,9 +171,9 @@ BattleTransition_BlackScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
; for non-dungeon trainer battles
@@ -337,7 +337,7 @@ BattleTransition_FlashScreen_:
cp 1
jr z, .done
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
jr .loop
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index d6ce6557..39e80e74 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -67,9 +67,9 @@ SlidePlayerAndEnemySilhouettesOnScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
.slideSilhouettesLoop ; slide silhouettes of the player's pic and the enemy's pic onto the screen
ld h, b
ld l, $40
@@ -905,8 +905,8 @@ ReplaceFaintedEnemyMon:
ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
callfar DrawEnemyPokeballs
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -4619,7 +4619,7 @@ CalculateDamage:
; Multi-hit attacks may or may not have 0 bp.
cp TWO_TO_FIVE_ATTACKS_EFFECT
jr z, .skipbp
- cp $1e
+ cp EFFECT_1E
jr z, .skipbp
; Calculate OHKO damage based on remaining HP.
@@ -5328,7 +5328,7 @@ MetronomePickMove:
and a
jr z, .pickMoveLoop
cp STRUGGLE
- assert NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
+ ASSERT NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
jr nc, .pickMoveLoop
cp METRONOME
jr z, .pickMoveLoop
@@ -6940,7 +6940,7 @@ HandleExplodingAnimation:
ret nz
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT
ld [wAnimationType], a
- assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
+ ASSERT ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
; ld a, MEGA_PUNCH
; fallthrough
PlayMoveAnimation:
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index a78de9ca..28e78c3d 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -236,8 +236,8 @@ FreezeBurnParalyzeEffect:
jr c, .regular_effectiveness
; extra effectiveness
ld b, 30 percent + 1
- assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
- assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
+ ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
+ ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on
.regular_effectiveness
push af
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 5b14f6df..1230b936 100644
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -2,7 +2,7 @@ MarowakAnim:
; animate the ghost being unveiled as a Marowak
ld a, $e4
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
hlcoord 12, 0
@@ -28,7 +28,7 @@ MarowakAnim:
sla a
sla a
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
jr nz, .fadeOutGhostLoop
call ClearSprites
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
@@ -42,7 +42,7 @@ MarowakAnim:
srl b
rra
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld a, b
and a
jr nz, .fadeInMarowakLoop
diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm
index d714109d..7843b1e2 100644
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -644,7 +644,7 @@ AICureStatus:
res BADLY_POISONED, [hl]
ret
-AIUseXAccuracy: ; unused
+AIUseXAccuracy: ; unreferenced
call AIPlayRestoringSFX
ld hl, wEnemyBattleStatus2
set USING_X_ACCURACY, [hl]
@@ -658,7 +658,7 @@ AIUseGuardSpec:
ld a, GUARD_SPEC
jp AIPrintItemUse
-AIUseDireHit: ; unused
+AIUseDireHit: ; unreferenced
call AIPlayRestoringSFX
ld hl, wEnemyBattleStatus2
set GETTING_PUMPED, [hl]