summaryrefslogtreecommitdiff
path: root/engine/battle
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2016-06-11 15:45:24 -0500
committerdannye <corrnondacqb@yahoo.com>2016-06-11 15:45:24 -0500
commit269f2c3ba72776e975f5b00d9a1361cadbda42a7 (patch)
tree459220542fcbfbd48b9725b48597b5740ee1ec0f /engine/battle
parent2bb64d11e6015e39e934e7359697c08636645994 (diff)
Sync with pokered
from August 29, 2015 to April 6, 2016
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/common_text.asm6
-rwxr-xr-xengine/battle/core.asm62
-rw-r--r--engine/battle/init_battle_variables.asm2
-rw-r--r--engine/battle/moveEffects/pay_day_effect.asm2
-rw-r--r--engine/battle/scale_sprites.asm8
5 files changed, 40 insertions, 40 deletions
diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm
index 0ca9ce96..a0c44346 100644
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -9,8 +9,8 @@ PrintBeginningBattleText: ; f4000 (3d:4000)
jr c, .pokemonTower
.notPokemonTower
ld a,[wBattleType]
- cp $4 ; new battle type?
- jr nz,.notnewbattletype
+ cp BATTLE_TYPE_PIKACHU
+ jr nz,.notPikachuBattle
callab IsPlayerPikachuAsleepInParty
ld e,$24
jr c,.asm_f4026
@@ -18,7 +18,7 @@ PrintBeginningBattleText: ; f4000 (3d:4000)
.asm_f4026
callab PlayPikachuSoundClip
jr .continue
-.notnewbattletype
+.notPikachuBattle
ld a, [wEnemyMonSpecies2]
call PlayCry
.continue
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 7a3eab32..665d79f7 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -250,9 +250,9 @@ StartBattle: ; 3c127 (f:4127)
call SaveScreenTilesToBuffer1
.checkAnyPartyAlive
ld a, [wBattleType]
- cp $3
+ cp BATTLE_TYPE_RUN
jp z, .specialBattle
- cp $4
+ cp BATTLE_TYPE_PIKACHU
jp z, .specialBattle
call AnyPartyAlive
ld a, d
@@ -1625,9 +1625,9 @@ TryRunningFromBattle: ; 3cb1e (f:4b1e)
call IsGhostBattle
jp z, .canEscape ; jump if it's a ghost battle
ld a, [wBattleType]
- cp $2
+ cp BATTLE_TYPE_SAFARI
jp z, .canEscape ; jump if it's a safari battle
- cp $3
+ cp BATTLE_TYPE_RUN
jp z, .canEscape ; hurry, get away?
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -1770,7 +1770,7 @@ LoadBattleMonFromParty: ; 3cc10 (f:4c10)
ld bc, NUM_MOVES
call CopyData
ld de, wBattleMonLevel
- ld bc, $b
+ ld bc, wBattleMonPP - wBattleMonLevel
call CopyData
ld a, [wBattleMonSpecies2]
ld [wd0b5], a
@@ -1814,7 +1814,7 @@ LoadEnemyMonFromParty: ; 3cc7d (f:4c7d)
ld bc, NUM_MOVES
call CopyData
ld de, wEnemyMonLevel
- ld bc, $b
+ ld bc, wEnemyMonPP - wEnemyMonLevel
call CopyData
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
@@ -1990,11 +1990,11 @@ DrawPlayerHUDAndHPBar: ; 3ce25 (f:4e25)
call PlaceString
ld hl, wBattleMonSpecies
ld de, wLoadedMon
- ld bc, $c
+ ld bc, wBattleMonDVs - wBattleMonSpecies
call CopyData
ld hl, wBattleMonLevel
ld de, wLoadedMonLevel
- ld bc, $b
+ ld bc, wBattleMonPP - wBattleMonLevel
call CopyData
coord hl, 14, 8
push hl
@@ -2171,7 +2171,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
call SaveScreenTilesToBuffer1
.nonstandardbattle
ld a, [wBattleType]
- cp $2 ; safari
+ cp BATTLE_TYPE_SAFARI
ld a, BATTLE_MENU_TEMPLATE
jr nz, .menuselected
ld a, SAFARI_BATTLE_MENU_TEMPLATE
@@ -2179,9 +2179,9 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
ld [wTextBoxID], a
call DisplayTextBoxID
ld a, [wBattleType]
- cp $1
+ cp BATTLE_TYPE_OLD_MAN
jr z, .doSimulatedMenuInput ; simulate menu input if it's the old man or prof. oak pikachu battle
- cp $4
+ cp BATTLE_TYPE_PIKACHU
jr z, .doSimulatedMenuInput
jp .handleBattleMenuInput
; the following happens for the old man tutorial and prof. oak pikachu battle
@@ -2234,7 +2234,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
jr .rightColumn
.leftColumn ; put cursor in left column of menu
ld a, [wBattleType]
- cp $2
+ cp BATTLE_TYPE_SAFARI
ld a, " "
jr z, .safariLeftColumn
; put cursor in left column for normal battle menu (i.e. when it's not a Safari battle)
@@ -2267,7 +2267,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
jr .AButtonPressed ; the A button was pressed
.rightColumn ; put cursor in right column of menu
ld a, [wBattleType]
- cp $2
+ cp BATTLE_TYPE_SAFARI
ld a, " "
jr z, .safariRightColumn
; put cursor in right column for normal battle menu (i.e. when it's not a Safari battle)
@@ -2304,10 +2304,10 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
.AButtonPressed
call PlaceUnfilledArrowMenuCursor
ld a, [wBattleType]
- cp HURRY_RUN_AWAY_BATTLE
+ cp BATTLE_TYPE_RUN
jr z, .handleUnusedBattle
ld a, [wBattleType]
- cp SAFARI_BATTLE ; is it a Safari battle?
+ cp BATTLE_TYPE_SAFARI
ld a, [wCurrentMenuItem]
ld [wBattleAndStartSavedMenuItem], a
jr z, .handleMenuSelection
@@ -2329,7 +2329,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
jr nz, .upperLeftMenuItemWasNotSelected
; the upper left menu item was selected
ld a, [wBattleType]
- cp $2
+ cp BATTLE_TYPE_SAFARI
jr z, .throwSafariBallWasSelected
; the "FIGHT" menu was selected
xor a
@@ -2368,7 +2368,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78)
.notLinkBattle
call SaveScreenTilesToBuffer2
ld a, [wBattleType]
- cp $2 ; is it a safari battle?
+ cp BATTLE_TYPE_SAFARI
jr nz, BagWasSelected
; bait was selected
@@ -2386,9 +2386,9 @@ BagWasSelected: ; 3d10a (f:510a)
call DrawHUDsAndHPBars
.next
ld a, [wBattleType]
- cp OLD_MAN_BATTLE ; is it the old man tutorial?
+ cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial?
jr z, .simulatedInputBattle
- cp STARTER_PIKACHU_BATTLE ; is it the prof oak battle with pikachu?
+ cp BATTLE_TYPE_PIKACHU ; is it the prof oak battle with pikachu?
jr z, .simulatedInputBattle
jr DisplayPlayerBag
.simulatedInputBattle
@@ -2441,7 +2441,7 @@ UseBagItem: ; 3c162 (f:5162)
xor a
ld [wCurrentMenuItem], a
ld a, [wBattleType]
- cp SAFARI_BATTLE ; is it a safari battle?
+ cp BATTLE_TYPE_SAFARI
jr z, .checkIfMonCaptured
ld a, [wActionResultOrTookBattleTurn]
@@ -2463,7 +2463,7 @@ UseBagItem: ; 3c162 (f:5162)
jr nz, .returnAfterCapturingMon
ld a, [wBattleType]
- cp SAFARI_BATTLE ; is it a safari battle?
+ cp BATTLE_TYPE_SAFARI
jr z, .returnAfterUsingItem_NoCapture
; not a safari battle
call LoadScreenTilesFromBuffer1
@@ -2494,7 +2494,7 @@ PartyMenuOrRockOrRun: ; 3d1cd (f:51cd)
; party menu or rock was selected
call SaveScreenTilesToBuffer2
ld a, [wBattleType]
- cp $2 ; is it a safari battle?
+ cp BATTLE_TYPE_SAFARI
jr nz, .partyMenuWasSelected
; safari battle
ld a, SAFARI_ROCK
@@ -3626,7 +3626,7 @@ CheckPlayerStatusConditions: ; 3d9c6 (f:59c6)
ld a,[wPlayerBattleStatus1]
add a ; is player confused?
jr nc,.TriedToUseDisabledMoveCheck
- ld hl,W_PLAYERCONFUSEDCOUNTER
+ ld hl,wPlayerConfusedCounter
dec [hl]
jr nz,.IsConfused
ld hl,wPlayerBattleStatus1
@@ -3764,7 +3764,7 @@ CheckPlayerStatusConditions: ; 3d9c6 (f:59c6)
and a,3
inc a
inc a ; confused for 2-5 turns
- ld [W_PLAYERCONFUSEDCOUNTER],a
+ ld [wPlayerConfusedCounter],a
pop hl ; skip DecrementPP
jp .returnToHL
@@ -6126,7 +6126,7 @@ CheckEnemyStatusConditions: ; 3ea15 (f:6a15)
ld a, [wEnemyBattleStatus1]
add a ; check if enemy mon is confused
jp nc, .checkIfTriedToUseDisabledMove
- ld hl, W_ENEMYCONFUSEDCOUNTER
+ ld hl, wEnemyConfusedCounter
dec [hl]
jr nz, .isConfused
ld hl, wEnemyBattleStatus1
@@ -6298,7 +6298,7 @@ CheckEnemyStatusConditions: ; 3ea15 (f:6a15)
and $3
inc a
inc a ; confused for 2-5 turns
- ld [W_ENEMYCONFUSEDCOUNTER], a
+ ld [wEnemyConfusedCounter], a
pop hl ; skip DecrementPP
jp .enemyReturnToHL
.checkIfUsingMultiturnMove
@@ -6576,10 +6576,10 @@ SwapPlayerAndEnemyLevels: ; 3ee07 (f:6e07)
LoadPlayerBackPic: ; 3ee18 (f:6e18)
ld a, [wBattleType]
ld de, OldManPic
- cp OLD_MAN_BATTLE ; is it the old man tutorial?
+ cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial?
jr z, .next
ld de, ProfOakPicBack
- cp STARTER_PIKACHU_BATTLE ; is it the pikachu battle at the beginning of the game?
+ cp BATTLE_TYPE_PIKACHU ; is it the pikachu battle at the beginning of the game?
jr z, .next
ld de, RedPicBack
.next
@@ -6624,7 +6624,7 @@ LoadPlayerBackPic: ; 3ee18 (f:6e18)
ld a, $0
call SwitchSRAMBankAndLatchClockData
ld hl, vSprites
- ld de, S_SPRITEBUFFER1
+ ld de, sSpriteBuffer1
ld a, [H_LOADEDROMBANK]
ld b, a
ld c, 7 * 7
@@ -8292,11 +8292,11 @@ ConfusionSideEffectSuccess: ; 3f94a (f:794a)
ld a, [H_WHOSETURN]
and a
ld hl, wEnemyBattleStatus1
- ld bc, W_ENEMYCONFUSEDCOUNTER
+ ld bc, wEnemyConfusedCounter
ld a, [wPlayerMoveEffect]
jr z, .confuseTarget
ld hl, wPlayerBattleStatus1
- ld bc, W_PLAYERCONFUSEDCOUNTER
+ ld bc, wPlayerConfusedCounter
ld a, [wEnemyMoveEffect]
.confuseTarget
bit Confused, [hl] ; is mon confused?
diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm
index 8c43e8f8..74ea3814 100644
--- a/engine/battle/init_battle_variables.asm
+++ b/engine/battle/init_battle_variables.asm
@@ -32,7 +32,7 @@ InitBattleVariables: ; f6236 (3d:6236)
jr c, .notSafariBattle
cp SAFARI_ZONE_REST_HOUSE_1
jr nc, .notSafariBattle
- ld a, $2 ; safari battle
+ ld a, BATTLE_TYPE_SAFARI
ld [wBattleType], a
.notSafariBattle
jpab PlayBattleMusic
diff --git a/engine/battle/moveEffects/pay_day_effect.asm b/engine/battle/moveEffects/pay_day_effect.asm
index 2fa6b53f..0236e3e4 100644
--- a/engine/battle/moveEffects/pay_day_effect.asm
+++ b/engine/battle/moveEffects/pay_day_effect.asm
@@ -1,4 +1,4 @@
-PayDayEffect_ ; f6511 (3d:6511)
+PayDayEffect_: ; f6511 (3d:6511)
xor a
ld hl, wcd6d
ld [hli], a
diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm
index 03495c82..c829fa13 100644
--- a/engine/battle/scale_sprites.asm
+++ b/engine/battle/scale_sprites.asm
@@ -9,12 +9,12 @@ ScaleSpriteByTwo: ; 2fd79 (b:7d79)
ret
ScaleSpriteByTwo_: ; 2fd85 (b:7d85)
- ld de, S_SPRITEBUFFER1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
- ld hl, S_SPRITEBUFFER0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
+ ld de, sSpriteBuffer1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
+ ld hl, sSpriteBuffer0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
call ScaleLastSpriteColumnByTwo ; last tile column is special case
call ScaleFirstThreeSpriteColumnsByTwo ; scale first 3 tile columns
- ld de, S_SPRITEBUFFER2 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
- ld hl, S_SPRITEBUFFER1 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
+ ld de, sSpriteBuffer2 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
+ ld hl, sSpriteBuffer1 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
call ScaleLastSpriteColumnByTwo ; last tile column is special case
ScaleFirstThreeSpriteColumnsByTwo: ; 2fd9a (b:7d9a)