mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-12-07 19:51:35 +13:00
Clean up white space
This commit is contained in:
parent
c43c338a5f
commit
39abace569
|
|
@ -1,4 +1,4 @@
|
||||||
; non-volatile statuses
|
; non-volatile statuses
|
||||||
SLP EQU %111 ; sleep counter
|
SLP EQU %111 ; sleep counter
|
||||||
PSN EQU 3
|
PSN EQU 3
|
||||||
BRN EQU 4
|
BRN EQU 4
|
||||||
|
|
@ -13,7 +13,7 @@ Flinched EQU 3
|
||||||
ChargingUp EQU 4 ; e.g. Solar Beam, Fly
|
ChargingUp EQU 4 ; e.g. Solar Beam, Fly
|
||||||
UsingTrappingMove EQU 5 ; e.g. Wrap
|
UsingTrappingMove EQU 5 ; e.g. Wrap
|
||||||
Invulnerable EQU 6 ; charging up Fly/Dig
|
Invulnerable EQU 6 ; charging up Fly/Dig
|
||||||
Confused EQU 7
|
Confused EQU 7
|
||||||
|
|
||||||
; volatile statuses 2
|
; volatile statuses 2
|
||||||
UsingXAccuracy EQU 0
|
UsingXAccuracy EQU 0
|
||||||
|
|
@ -26,7 +26,7 @@ UsingRage EQU 6
|
||||||
Seeded EQU 7
|
Seeded EQU 7
|
||||||
|
|
||||||
; volatile statuses 3
|
; volatile statuses 3
|
||||||
BadlyPoisoned EQU 0
|
BadlyPoisoned EQU 0
|
||||||
HasLightScreenUp EQU 1
|
HasLightScreenUp EQU 1
|
||||||
HasReflectUp EQU 2
|
HasReflectUp EQU 2
|
||||||
Transformed EQU 3
|
Transformed EQU 3
|
||||||
|
|
|
||||||
|
|
@ -1023,7 +1023,7 @@ TrainerBattleVictory: ; 3c696 (f:4696)
|
||||||
ld c, $28
|
ld c, $28
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call PrintEndBattleText
|
call PrintEndBattleText
|
||||||
; win money
|
; win money
|
||||||
ld hl, MoneyForWinningText
|
ld hl, MoneyForWinningText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld de, wPlayerMoney + 2
|
ld de, wPlayerMoney + 2
|
||||||
|
|
@ -1642,7 +1642,7 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9)
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [H_QUOTIENT + 3]
|
ld a, [H_QUOTIENT + 3]
|
||||||
cp b
|
cp b
|
||||||
jr nc, .canEscape ; if the random value was less than or equal to the quotient
|
jr nc, .canEscape ; if the random value was less than or equal to the quotient
|
||||||
; plus 30 times the number of attempts, the player can escape
|
; plus 30 times the number of attempts, the player can escape
|
||||||
; can't escape
|
; can't escape
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -2930,8 +2930,8 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $0 ; which item in the menu is the cursor pointing to? (0-3)
|
ld b, $0 ; which item in the menu is the cursor pointing to? (0-3)
|
||||||
add hl, bc ; point to the item (move) in memory
|
add hl, bc ; point to the item (move) in memory
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wPlayerSelectedMove], a ; update wPlayerSelectedMove even if the move
|
ld [wPlayerSelectedMove], a ; update wPlayerSelectedMove even if the move
|
||||||
; isn't actually selected (just pointed to by the cursor)
|
; isn't actually selected (just pointed to by the cursor)
|
||||||
ld a, [wPlayerMonNumber]
|
ld a, [wPlayerMonNumber]
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
|
|
@ -2947,7 +2947,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and $3f
|
and $3f
|
||||||
ld [wcd6d], a
|
ld [wcd6d], a
|
||||||
; print TYPE/<type> and <curPP>/<maxPP>
|
; print TYPE/<type> and <curPP>/<maxPP>
|
||||||
hlCoord 1, 9
|
hlCoord 1, 9
|
||||||
ld de, TypeText
|
ld de, TypeText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
|
|
@ -2963,7 +2963,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
|
||||||
ld de, wd11e
|
ld de, wd11e
|
||||||
ld bc, $102
|
ld bc, $102
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
call GetCurrentMove
|
call GetCurrentMove
|
||||||
hlCoord 2, 10
|
hlCoord 2, 10
|
||||||
predef PrintMoveType
|
predef PrintMoveType
|
||||||
.moveDisabled
|
.moveDisabled
|
||||||
|
|
@ -3174,13 +3174,13 @@ PlayerCanExecuteMove: ; 3d6b0 (f:56b0)
|
||||||
ld hl,ResidualEffects1
|
ld hl,ResidualEffects1
|
||||||
ld de,1
|
ld de,1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests
|
jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests
|
||||||
; unless executed as part of their exclusive effect functions
|
; unless executed as part of their exclusive effect functions
|
||||||
ld a,[W_PLAYERMOVEEFFECT]
|
ld a,[W_PLAYERMOVEEFFECT]
|
||||||
ld hl,SpecialEffectsCont
|
ld hl,SpecialEffectsCont
|
||||||
ld de,1
|
ld de,1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything
|
call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything
|
||||||
PlayerCalcMoveDamage: ; 3d6dc (f:56dc)
|
PlayerCalcMoveDamage: ; 3d6dc (f:56dc)
|
||||||
ld a,[W_PLAYERMOVEEFFECT]
|
ld a,[W_PLAYERMOVEEFFECT]
|
||||||
ld hl,SetDamageEffects
|
ld hl,SetDamageEffects
|
||||||
|
|
@ -3203,7 +3203,7 @@ handleIfPlayerMoveMissed
|
||||||
and a
|
and a
|
||||||
jr z,getPlayerAnimationType
|
jr z,getPlayerAnimationType
|
||||||
ld a,[W_PLAYERMOVEEFFECT]
|
ld a,[W_PLAYERMOVEEFFECT]
|
||||||
sub a,EXPLODE_EFFECT
|
sub a,EXPLODE_EFFECT
|
||||||
jr z,playPlayerMoveAnimation ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT
|
jr z,playPlayerMoveAnimation ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT
|
||||||
jr playerCheckIfFlyOrChargeEffect
|
jr playerCheckIfFlyOrChargeEffect
|
||||||
getPlayerAnimationType
|
getPlayerAnimationType
|
||||||
|
|
@ -3298,7 +3298,7 @@ MirrorMoveCheck
|
||||||
ld a,[wPlayerNumAttacksLeft]
|
ld a,[wPlayerNumAttacksLeft]
|
||||||
dec a
|
dec a
|
||||||
ld [wPlayerNumAttacksLeft],a
|
ld [wPlayerNumAttacksLeft],a
|
||||||
jp nz,getPlayerAnimationType ; for multi-hit moves, apply attack until PlayerNumAttacksLeft hits 0 or the enemy faints.
|
jp nz,getPlayerAnimationType ; for multi-hit moves, apply attack until PlayerNumAttacksLeft hits 0 or the enemy faints.
|
||||||
; damage calculation and accuracy tests only happen for the first hit
|
; damage calculation and accuracy tests only happen for the first hit
|
||||||
res AttackingMultipleTimes,[hl] ; clear attacking multiple times status when all attacks are over
|
res AttackingMultipleTimes,[hl] ; clear attacking multiple times status when all attacks are over
|
||||||
ld hl,MultiHitText
|
ld hl,MultiHitText
|
||||||
|
|
@ -3509,8 +3509,8 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
.MonHurtItselfOrFullyParalysed
|
.MonHurtItselfOrFullyParalysed
|
||||||
ld hl,W_PLAYERBATTSTATUS1
|
ld hl,W_PLAYERBATTSTATUS1
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
|
; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
|
||||||
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
ld a,[W_PLAYERMOVEEFFECT]
|
ld a,[W_PLAYERMOVEEFFECT]
|
||||||
cp a,FLY_EFFECT
|
cp a,FLY_EFFECT
|
||||||
|
|
@ -3588,7 +3588,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
ld hl,wPlayerNumAttacksLeft
|
ld hl,wPlayerNumAttacksLeft
|
||||||
dec [hl] ; did Thrashing About counter hit 0?
|
dec [hl] ; did Thrashing About counter hit 0?
|
||||||
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
|
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
|
||||||
jp nz,.returnToHL
|
jp nz,.returnToHL
|
||||||
push hl
|
push hl
|
||||||
ld hl,W_PLAYERBATTSTATUS1
|
ld hl,W_PLAYERBATTSTATUS1
|
||||||
res ThrashingAbout,[hl] ; no longer thrashing about
|
res ThrashingAbout,[hl] ; no longer thrashing about
|
||||||
|
|
@ -3609,7 +3609,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
ld a,[wPlayerNumAttacksLeft]
|
ld a,[wPlayerNumAttacksLeft]
|
||||||
dec a ; did multi-turn move end?
|
dec a ; did multi-turn move end?
|
||||||
ld [wPlayerNumAttacksLeft],a
|
ld [wPlayerNumAttacksLeft],a
|
||||||
ld hl,getPlayerAnimationType ; if it didn't, skip damage calculation (deal damage equal to last hit),
|
ld hl,getPlayerAnimationType ; if it didn't, skip damage calculation (deal damage equal to last hit),
|
||||||
; DecrementPP and MoveHitTest
|
; DecrementPP and MoveHitTest
|
||||||
jp nz,.returnToHL
|
jp nz,.returnToHL
|
||||||
jp .returnToHL
|
jp .returnToHL
|
||||||
|
|
@ -3706,7 +3706,7 @@ PrintMoveIsDisabledText: ; 3da88 (f:5a88)
|
||||||
ld de, W_ENEMYBATTSTATUS1
|
ld de, W_ENEMYBATTSTATUS1
|
||||||
.removeChargingUp
|
.removeChargingUp
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
res ChargingUp, a ; end the pokemon's
|
res ChargingUp, a ; end the pokemon's
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
|
|
@ -3923,7 +3923,7 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2)
|
||||||
|
|
||||||
; if you get here, the mon used jump kick or hi jump kick and missed
|
; if you get here, the mon used jump kick or hi jump kick and missed
|
||||||
ld hl, W_DAMAGE ; since the move missed, W_DAMAGE will always contain 0 at this point.
|
ld hl, W_DAMAGE ; since the move missed, W_DAMAGE will always contain 0 at this point.
|
||||||
; Thus, recoil damage will always be equal to 1
|
; Thus, recoil damage will always be equal to 1
|
||||||
; even if it was intended to be potential damage/8.
|
; even if it was intended to be potential damage/8.
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
|
|
@ -4776,7 +4776,7 @@ HandleCounterMove: ; 3e093 (f:6093)
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
or [hl]
|
or [hl]
|
||||||
ret z ; If we made it here, Counter still misses if the last move used in battle did no damage to its target.
|
ret z ; If we made it here, Counter still misses if the last move used in battle did no damage to its target.
|
||||||
; W_DAMAGE is shared by both players, so Counter may strike back damage dealt by the Counter user itself
|
; W_DAMAGE is shared by both players, so Counter may strike back damage dealt by the Counter user itself
|
||||||
; if the conditions meet, even though 99% of the times damage will come from the target.
|
; if the conditions meet, even though 99% of the times damage will come from the target.
|
||||||
; if it did damage, double it
|
; if it did damage, double it
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
|
|
@ -5037,9 +5037,9 @@ ApplyAttackToPlayerPokemonDone
|
||||||
AttackSubstitute: ; 3e25e (f:625e)
|
AttackSubstitute: ; 3e25e (f:625e)
|
||||||
; Unlike the two ApplyAttackToPokemon functions, Attack Substitute is shared by player and enemy.
|
; Unlike the two ApplyAttackToPokemon functions, Attack Substitute is shared by player and enemy.
|
||||||
; Self-confusion damage as well as Hi-Jump Kick and Jump Kick recoil cause a momentary turn swap before being applied.
|
; Self-confusion damage as well as Hi-Jump Kick and Jump Kick recoil cause a momentary turn swap before being applied.
|
||||||
; If the user has a Substitute up and would take damage because of that,
|
; If the user has a Substitute up and would take damage because of that,
|
||||||
; damage will be applied to the other player's Substitute.
|
; damage will be applied to the other player's Substitute.
|
||||||
; Normal recoil such as from Double-Edge isn't affected by this glitch,
|
; Normal recoil such as from Double-Edge isn't affected by this glitch,
|
||||||
; because this function is never called in that case.
|
; because this function is never called in that case.
|
||||||
|
|
||||||
ld hl,SubstituteTookDamageText
|
ld hl,SubstituteTookDamageText
|
||||||
|
|
@ -5064,7 +5064,7 @@ AttackSubstitute: ; 3e25e (f:625e)
|
||||||
ld [de],a
|
ld [de],a
|
||||||
ret nc
|
ret nc
|
||||||
.substituteBroke
|
.substituteBroke
|
||||||
; If the target's Substitute breaks, W_DAMAGE isn't updated with the amount of HP
|
; If the target's Substitute breaks, W_DAMAGE isn't updated with the amount of HP
|
||||||
; the Substitute had before being attacked.
|
; the Substitute had before being attacked.
|
||||||
ld h,b
|
ld h,b
|
||||||
ld l,c
|
ld l,c
|
||||||
|
|
@ -6023,7 +6023,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
|
||||||
.monHurtItselfOrFullyParalysed
|
.monHurtItselfOrFullyParalysed
|
||||||
ld hl, W_ENEMYBATTSTATUS1
|
ld hl, W_ENEMYBATTSTATUS1
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
; clear bide, thrashing about, charging up, and multi-turn moves such as warp
|
; clear bide, thrashing about, charging up, and multi-turn moves such as warp
|
||||||
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, [W_ENEMYMOVEEFFECT]
|
ld a, [W_ENEMYMOVEEFFECT]
|
||||||
|
|
@ -6119,7 +6119,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wEnemyNumAttacksLeft
|
ld hl, wEnemyNumAttacksLeft
|
||||||
dec [hl] ; did multi-turn move end?
|
dec [hl] ; did multi-turn move end?
|
||||||
ld hl, GetEnemyAnimationType ; if it didn't, skip damage calculation (deal damage equal to last hit),
|
ld hl, GetEnemyAnimationType ; if it didn't, skip damage calculation (deal damage equal to last hit),
|
||||||
; DecrementPP and MoveHitTest
|
; DecrementPP and MoveHitTest
|
||||||
jp nz, .enemyReturnToHL
|
jp nz, .enemyReturnToHL
|
||||||
jp .enemyReturnToHL
|
jp .enemyReturnToHL
|
||||||
|
|
@ -6753,8 +6753,8 @@ BattleRandom:
|
||||||
push hl
|
push hl
|
||||||
push bc
|
push bc
|
||||||
push af
|
push af
|
||||||
|
|
||||||
; point to seed 0 so we pick the first number the next time
|
; point to seed 0 so we pick the first number the next time
|
||||||
xor a
|
xor a
|
||||||
ld [wLinkBattleRandomNumberListIndex], a
|
ld [wLinkBattleRandomNumberListIndex], a
|
||||||
|
|
||||||
|
|
@ -6763,11 +6763,11 @@ BattleRandom:
|
||||||
.loop
|
.loop
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld c, a
|
ld c, a
|
||||||
; multiply by 5
|
; multiply by 5
|
||||||
add a
|
add a
|
||||||
add a
|
add a
|
||||||
add c
|
add c
|
||||||
; add 1
|
; add 1
|
||||||
inc a
|
inc a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec b
|
dec b
|
||||||
|
|
@ -7052,7 +7052,7 @@ asm_3f0d0: ; 3f0d0 (f:70d0)
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_3f0de
|
jr nz, .asm_3f0de
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_3f0ed
|
.asm_3f0ed
|
||||||
push bc
|
push bc
|
||||||
ld b, $0
|
ld b, $0
|
||||||
|
|
@ -7604,17 +7604,17 @@ StatModifierUpEffect: ; 3f428 (f:7428)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
pop bc
|
pop bc
|
||||||
xor a
|
xor a
|
||||||
ld [H_MULTIPLICAND], a
|
ld [H_MULTIPLICAND], a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [H_MULTIPLICAND + 1], a
|
ld [H_MULTIPLICAND + 1], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [H_MULTIPLICAND + 2], a
|
ld [H_MULTIPLICAND + 2], a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [H_MULTIPLIER], a
|
ld [H_MULTIPLIER], a
|
||||||
call Multiply
|
call Multiply
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [H_DIVISOR], a
|
ld [H_DIVISOR], a
|
||||||
ld b, $4
|
ld b, $4
|
||||||
call Divide
|
call Divide
|
||||||
pop hl
|
pop hl
|
||||||
|
|
@ -7822,17 +7822,17 @@ StatModifierDownEffect: ; 3f54c (f:754c)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
pop bc
|
pop bc
|
||||||
xor a
|
xor a
|
||||||
ld [H_MULTIPLICAND], a
|
ld [H_MULTIPLICAND], a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [H_MULTIPLICAND + 1], a
|
ld [H_MULTIPLICAND + 1], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [H_MULTIPLICAND + 2], a
|
ld [H_MULTIPLICAND + 2], a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [H_MULTIPLIER], a
|
ld [H_MULTIPLIER], a
|
||||||
call Multiply
|
call Multiply
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [H_DIVISOR], a
|
ld [H_DIVISOR], a
|
||||||
ld b, $4
|
ld b, $4
|
||||||
call Divide
|
call Divide
|
||||||
pop hl
|
pop hl
|
||||||
|
|
@ -8287,8 +8287,8 @@ TrappingEffect: ; 3f917 (f:7917)
|
||||||
.trappingEffect
|
.trappingEffect
|
||||||
bit UsingTrappingMove, [hl]
|
bit UsingTrappingMove, [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call ClearHyperBeam ; since this effect is called before testing whether the move will hit,
|
call ClearHyperBeam ; since this effect is called before testing whether the move will hit,
|
||||||
; the target won't need to recharge even if the trapping move missed
|
; the target won't need to recharge even if the trapping move missed
|
||||||
set UsingTrappingMove, [hl] ; mon is now using a trapping move
|
set UsingTrappingMove, [hl] ; mon is now using a trapping move
|
||||||
call BattleRandom ; 3/8 chance for 2 and 3 attacks, and 1/8 chance for 4 and 5 attacks
|
call BattleRandom ; 3/8 chance for 2 and 3 attacks, and 1/8 chance for 4 and 5 attacks
|
||||||
and $3
|
and $3
|
||||||
|
|
@ -8346,7 +8346,7 @@ ConfusionSideEffectSuccess: ; 3f96f (f:796f)
|
||||||
set Confused, [hl] ; mon is now confused
|
set Confused, [hl] ; mon is now confused
|
||||||
push af
|
push af
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
and $3
|
and $3
|
||||||
inc a
|
inc a
|
||||||
inc a
|
inc a
|
||||||
ld [bc], a ; confusion status will last 2-5 turns
|
ld [bc], a ; confusion status will last 2-5 turns
|
||||||
|
|
@ -8527,12 +8527,12 @@ DisableEffect: ; 3fa8a (f:7a8a)
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld hl, wBattleMonPP
|
ld hl, wBattleMonPP
|
||||||
jr nz, .enemyTurn
|
jr nz, .enemyTurn
|
||||||
ld a, [wLinkState]
|
ld a, [wLinkState]
|
||||||
cp LINK_STATE_BATTLING
|
cp LINK_STATE_BATTLING
|
||||||
pop hl ; wEnemyMonMoves
|
pop hl ; wEnemyMonMoves
|
||||||
jr nz, .playerTurnNotLinkBattle
|
jr nz, .playerTurnNotLinkBattle
|
||||||
; .playerTurnLinkBattle
|
; .playerTurnLinkBattle
|
||||||
push hl
|
push hl
|
||||||
ld hl, wEnemyMonPP
|
ld hl, wEnemyMonPP
|
||||||
.enemyTurn
|
.enemyTurn
|
||||||
|
|
@ -8557,7 +8557,7 @@ DisableEffect: ; 3fa8a (f:7a8a)
|
||||||
and $7
|
and $7
|
||||||
inc a ; 1-8 turns disabled
|
inc a ; 1-8 turns disabled
|
||||||
inc c ; move 1-4 will be disabled
|
inc c ; move 1-4 will be disabled
|
||||||
swap c
|
swap c
|
||||||
add c ; map disabled move to high nibble of W_ENEMYDISABLEDMOVE / W_PLAYERDISABLEDMOVE
|
add c ; map disabled move to high nibble of W_ENEMYDISABLEDMOVE / W_PLAYERDISABLEDMOVE
|
||||||
ld [de], a
|
ld [de], a
|
||||||
call PlayCurrentMoveAnimation2
|
call PlayCurrentMoveAnimation2
|
||||||
|
|
@ -8568,7 +8568,7 @@ DisableEffect: ; 3fa8a (f:7a8a)
|
||||||
inc hl ; wEnemyDisabledMoveNumber
|
inc hl ; wEnemyDisabledMoveNumber
|
||||||
.printDisableText
|
.printDisableText
|
||||||
ld a, [wd11e] ; move number
|
ld a, [wd11e] ; move number
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
ld hl, MoveWasDisabledText
|
ld hl, MoveWasDisabledText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
@ -8659,12 +8659,12 @@ ParalyzedMayNotAttackText: ; 3fb74 (f:7b74)
|
||||||
CheckTargetSubstitute: ; 3fb79 (f:7b79)
|
CheckTargetSubstitute: ; 3fb79 (f:7b79)
|
||||||
push hl
|
push hl
|
||||||
ld hl, W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .next1
|
jr z, .next1
|
||||||
ld hl, W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
.next1
|
.next1
|
||||||
bit HasSubstituteUp, [hl]
|
bit HasSubstituteUp, [hl]
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,15 @@ DecrementPP: ; 68000 (1a:4000)
|
||||||
; W_PLAYERBATTSTATUS2 status flags later
|
; W_PLAYERBATTSTATUS2 status flags later
|
||||||
and a, (1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << AttackingMultipleTimes)
|
and a, (1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << AttackingMultipleTimes)
|
||||||
ret nz ; if any of these statuses are true, don't decrement PP
|
ret nz ; if any of these statuses are true, don't decrement PP
|
||||||
bit UsingRage, [hl]
|
bit UsingRage, [hl]
|
||||||
ret nz ; don't decrement PP either if Pokemon is using Rage
|
ret nz ; don't decrement PP either if Pokemon is using Rage
|
||||||
ld hl, wBattleMonPP ; PP of first move (in battle)
|
ld hl, wBattleMonPP ; PP of first move (in battle)
|
||||||
|
|
||||||
; decrement PP in the battle struct
|
; decrement PP in the battle struct
|
||||||
call .DecrementPP
|
call .DecrementPP
|
||||||
|
|
||||||
; decrement PP in the party struct
|
; decrement PP in the party struct
|
||||||
ld a, [W_PLAYERBATTSTATUS3]
|
ld a, [W_PLAYERBATTSTATUS3]
|
||||||
bit Transformed, a
|
bit Transformed, a
|
||||||
ret nz ; Return if transformed. Pokemon Red stores the "current pokemon's" PP
|
ret nz ; Return if transformed. Pokemon Red stores the "current pokemon's" PP
|
||||||
; separately from the "Pokemon in your party's" PP. This is
|
; separately from the "Pokemon in your party's" PP. This is
|
||||||
|
|
@ -31,7 +31,7 @@ DecrementPP: ; 68000 (1a:4000)
|
||||||
|
|
||||||
ld hl, wPartyMon1PP ; PP of first move (in party)
|
ld hl, wPartyMon1PP ; PP of first move (in party)
|
||||||
ld a, [wPlayerMonNumber] ; which mon in party is active
|
ld a, [wPlayerMonNumber] ; which mon in party is active
|
||||||
ld bc, wPartyMon2 - wPartyMon1
|
ld bc, wPartyMon2 - wPartyMon1
|
||||||
call AddNTimes ; calculate address of the mon to modify
|
call AddNTimes ; calculate address of the mon to modify
|
||||||
.DecrementPP
|
.DecrementPP
|
||||||
ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use?
|
ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use?
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ InitBattleVariables: ; 525af (14:65af)
|
||||||
ld [wCriticalHitOrOHKO], a
|
ld [wCriticalHitOrOHKO], a
|
||||||
ld [wBattleMonSpecies], a
|
ld [wBattleMonSpecies], a
|
||||||
ld [wPartyGainExpFlags], a
|
ld [wPartyGainExpFlags], a
|
||||||
ld [wPlayerMonNumber], a
|
ld [wPlayerMonNumber], a
|
||||||
ld [wEscapedFromBattle], a
|
ld [wEscapedFromBattle], a
|
||||||
ld [wMapPalOffset], a
|
ld [wMapPalOffset], a
|
||||||
ld hl, wcf1d
|
ld hl, wcf1d
|
||||||
|
|
@ -27,7 +27,7 @@ InitBattleVariables: ; 525af (14:65af)
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
inc a
|
inc a
|
||||||
ld [wccd9], a
|
ld [wccd9], a
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
cp SAFARI_ZONE_EAST
|
cp SAFARI_ZONE_EAST
|
||||||
jr c, .notSafariBattle
|
jr c, .notSafariBattle
|
||||||
cp SAFARI_ZONE_REST_HOUSE_1
|
cp SAFARI_ZONE_REST_HOUSE_1
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ ConversionEffect_: ; 139a3 (4:79a3)
|
||||||
.conversionEffect
|
.conversionEffect
|
||||||
bit Invulnerable, a ; is mon immune to typical attacks (dig/fly)
|
bit Invulnerable, a ; is mon immune to typical attacks (dig/fly)
|
||||||
jr nz, PrintButItFailedText
|
jr nz, PrintButItFailedText
|
||||||
; copy target's types to user
|
; copy target's types to user
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
DrainHPEffect_: ; 783f (1:783f)
|
DrainHPEffect_: ; 783f (1:783f)
|
||||||
ld hl, W_DAMAGE
|
ld hl, W_DAMAGE
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
srl a ; divide damage by 2
|
srl a ; divide damage by 2
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -17,8 +17,8 @@ DrainHPEffect_: ; 783f (1:783f)
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jp z, .addDamageToAttackerHP
|
jp z, .addDamageToAttackerHP
|
||||||
ld hl, wEnemyMonHP
|
ld hl, wEnemyMonHP
|
||||||
ld de, wEnemyMonMaxHP
|
ld de, wEnemyMonMaxHP
|
||||||
.addDamageToAttackerHP
|
.addDamageToAttackerHP
|
||||||
ld bc, wHPBarOldHP+1
|
ld bc, wHPBarOldHP+1
|
||||||
; copy current HP to wHPBarOldHP
|
; copy current HP to wHPBarOldHP
|
||||||
|
|
@ -41,7 +41,7 @@ DrainHPEffect_: ; 783f (1:783f)
|
||||||
add b
|
add b
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ld [wHPBarNewHP], a
|
ld [wHPBarNewHP], a
|
||||||
ld a, [W_DAMAGE]
|
ld a, [W_DAMAGE]
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
adc b
|
adc b
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -87,7 +87,7 @@ DrainHPEffect_: ; 783f (1:783f)
|
||||||
and a
|
and a
|
||||||
ld a, [W_PLAYERMOVEEFFECT]
|
ld a, [W_PLAYERMOVEEFFECT]
|
||||||
jr z, .next3
|
jr z, .next3
|
||||||
ld a, [W_ENEMYMOVEEFFECT]
|
ld a, [W_ENEMYMOVEEFFECT]
|
||||||
.next3
|
.next3
|
||||||
cp DREAM_EATER_EFFECT
|
cp DREAM_EATER_EFFECT
|
||||||
jr nz, .printText
|
jr nz, .printText
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
HazeEffect_: ; 139da (4:79da)
|
HazeEffect_: ; 139da (4:79da)
|
||||||
ld a, $7
|
ld a, $7
|
||||||
; store 7 on every stat mod
|
; store 7 on every stat mod
|
||||||
ld hl, wPlayerMonAttackMod
|
ld hl, wPlayerMonAttackMod
|
||||||
call ResetStatMods
|
call ResetStatMods
|
||||||
ld hl, wEnemyMonAttackMod
|
ld hl, wEnemyMonAttackMod
|
||||||
call ResetStatMods
|
call ResetStatMods
|
||||||
; copy unmodified stats to battle stats
|
; copy unmodified stats to battle stats
|
||||||
ld hl, wPlayerMonUnmodifiedAttack
|
ld hl, wPlayerMonUnmodifiedAttack
|
||||||
ld de, wBattleMonAttack
|
ld de, wBattleMonAttack
|
||||||
call ResetStats
|
call ResetStats
|
||||||
|
|
@ -25,7 +25,7 @@ HazeEffect_: ; 139da (4:79da)
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
and SLP | (1 << FRZ)
|
and SLP | (1 << FRZ)
|
||||||
jr z, .cureVolatileStatuses
|
jr z, .cureVolatileStatuses
|
||||||
; prevent the Pokemon from executing a move if it was asleep or frozen
|
; prevent the Pokemon from executing a move if it was asleep or frozen
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [de], a
|
ld [de], a
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37)
|
||||||
inc hl ; BATTSTATUS2
|
inc hl ; BATTSTATUS2
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
; clear UsingXAccuracy, ProtectedByMist, GettingPumped, and Seeded statuses
|
; clear UsingXAccuracy, ProtectedByMist, GettingPumped, and Seeded statuses
|
||||||
and $ff ^((1 << UsingXAccuracy) | (1 << ProtectedByMist) | (1 << GettingPumped) | (1 << Seeded))
|
and $ff ^((1 << UsingXAccuracy) | (1 << ProtectedByMist) | (1 << GettingPumped) | (1 << Seeded))
|
||||||
ld [hli], a ; BATTSTATUS3
|
ld [hli], a ; BATTSTATUS3
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses
|
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses
|
||||||
|
|
@ -61,7 +61,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37)
|
||||||
ResetStatMods: ; 13a43 (4:7a43)
|
ResetStatMods: ; 13a43 (4:7a43)
|
||||||
ld b, $8
|
ld b, $8
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec b
|
dec b
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
sbc [hl]
|
sbc [hl]
|
||||||
jr c, .playAnim
|
jr c, .playAnim
|
||||||
; copy max HP to current HP if an overflow ocurred
|
; copy max HP to current HP if an overflow ocurred
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld [wHPBarNewHP+1], a
|
ld [wHPBarNewHP+1], a
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
LeechSeedEffect_: ; 2bea9 (a:7ea9)
|
LeechSeedEffect_: ; 2bea9 (a:7ea9)
|
||||||
callab MoveHitTest
|
callab MoveHitTest
|
||||||
ld a, [W_MOVEMISSED]
|
ld a, [W_MOVEMISSED]
|
||||||
and a
|
and a
|
||||||
jr nz, .moveMissed
|
jr nz, .moveMissed
|
||||||
ld hl, W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
ld de, wEnemyMonType1
|
ld de, wEnemyMonType1
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .leechSeedEffect
|
jr z, .leechSeedEffect
|
||||||
ld hl, W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
ld de, wBattleMonType1
|
ld de, wBattleMonType1
|
||||||
.leechSeedEffect
|
.leechSeedEffect
|
||||||
; miss if the target is grass-type or already seeded
|
; miss if the target is grass-type or already seeded
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp GRASS
|
cp GRASS
|
||||||
jr z, .moveMissed
|
jr z, .moveMissed
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp GRASS
|
cp GRASS
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
OneHitKOEffect_: ; 33f57 (c:7f57)
|
OneHitKOEffect_: ; 33f57 (c:7f57)
|
||||||
ld hl, W_DAMAGE
|
ld hl, W_DAMAGE
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a ; set the damage output to zero
|
ld [hl], a ; set the damage output to zero
|
||||||
|
|
@ -7,7 +7,7 @@ OneHitKOEffect_: ; 33f57 (c:7f57)
|
||||||
ld [wCriticalHitOrOHKO], a
|
ld [wCriticalHitOrOHKO], a
|
||||||
ld hl, wBattleMonSpeed + 1
|
ld hl, wBattleMonSpeed + 1
|
||||||
ld de, wEnemyMonSpeed + 1
|
ld de, wEnemyMonSpeed + 1
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .compareSpeed
|
jr z, .compareSpeed
|
||||||
ld hl, wEnemyMonSpeed + 1
|
ld hl, wEnemyMonSpeed + 1
|
||||||
|
|
@ -24,7 +24,7 @@ OneHitKOEffect_: ; 33f57 (c:7f57)
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
sbc b
|
sbc b
|
||||||
jr c, .userIsSlower
|
jr c, .userIsSlower
|
||||||
ld hl, W_DAMAGE
|
ld hl, W_DAMAGE
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
@ -34,5 +34,5 @@ OneHitKOEffect_: ; 33f57 (c:7f57)
|
||||||
.userIsSlower
|
.userIsSlower
|
||||||
; keep damage at 0 and set move missed flag if target's current speed is higher instead
|
; keep damage at 0 and set move missed flag if target's current speed is higher instead
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [W_MOVEMISSED], a
|
ld [W_MOVEMISSED], a
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ ParalyzeEffect_: ; 52601 (14:6601)
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jp z, .next
|
jp z, .next
|
||||||
ld hl, wBattleMonStatus
|
ld hl, wBattleMonStatus
|
||||||
ld de, W_ENEMYMOVETYPE
|
ld de, W_ENEMYMOVETYPE
|
||||||
.next
|
.next
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
|
|
@ -28,7 +28,7 @@ ParalyzeEffect_: ; 52601 (14:6601)
|
||||||
push hl
|
push hl
|
||||||
callab MoveHitTest
|
callab MoveHitTest
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [W_MOVEMISSED]
|
ld a, [W_MOVEMISSED]
|
||||||
and a
|
and a
|
||||||
jr nz, .didntAffect
|
jr nz, .didntAffect
|
||||||
set PAR, [hl]
|
set PAR, [hl]
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,19 @@ PayDayEffect_ ; 2feb8 (b:7eb8)
|
||||||
ld a, [wEnemyMonLevel]
|
ld a, [wEnemyMonLevel]
|
||||||
.payDayEffect
|
.payDayEffect
|
||||||
; level * 2
|
; level * 2
|
||||||
add a
|
add a
|
||||||
ld [H_DIVIDEND + 3], a
|
ld [H_DIVIDEND + 3], a
|
||||||
xor a
|
xor a
|
||||||
ld [H_DIVIDEND], a
|
ld [H_DIVIDEND], a
|
||||||
ld [H_DIVIDEND + 1], a
|
ld [H_DIVIDEND + 1], a
|
||||||
ld [H_DIVIDEND + 2], a
|
ld [H_DIVIDEND + 2], a
|
||||||
; convert to BCD
|
; convert to BCD
|
||||||
ld a, 100
|
ld a, 100
|
||||||
ld [H_DIVISOR], a
|
ld [H_DIVISOR], a
|
||||||
ld b, $4
|
ld b, $4
|
||||||
call Divide
|
call Divide
|
||||||
ld a, [H_QUOTIENT + 3]
|
ld a, [H_QUOTIENT + 3]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [H_REMAINDER]
|
ld a, [H_REMAINDER]
|
||||||
ld [H_DIVIDEND + 3], a
|
ld [H_DIVIDEND + 3], a
|
||||||
ld a, 10
|
ld a, 10
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ RecoilEffect_: ; 1392c (4:792c)
|
||||||
ld [wHPBarNewHP+1], a
|
ld [wHPBarNewHP+1], a
|
||||||
jr nc, .getHPBarCoords
|
jr nc, .getHPBarCoords
|
||||||
; if recoil damage is higher than the Pokemon's HP, set its HP to 0
|
; if recoil damage is higher than the Pokemon's HP, set its HP to 0
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wHPBarNewHP
|
ld hl, wHPBarNewHP
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,15 @@ SubstituteEffect_: ; 17dad (5:7dad)
|
||||||
ld de, wEnemySubstituteHP
|
ld de, wEnemySubstituteHP
|
||||||
ld bc, W_ENEMYBATTSTATUS2
|
ld bc, W_ENEMYBATTSTATUS2
|
||||||
.notEnemy
|
.notEnemy
|
||||||
ld a, [bc]
|
ld a, [bc]
|
||||||
bit HasSubstituteUp, a ; user already has substitute?
|
bit HasSubstituteUp, a ; user already has substitute?
|
||||||
jr nz, .alreadyHasSubstitute
|
jr nz, .alreadyHasSubstitute
|
||||||
; quarter health to remove from user
|
; quarter health to remove from user
|
||||||
; assumes max HP is 1023 or lower
|
; assumes max HP is 1023 or lower
|
||||||
push bc
|
push bc
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
srl a
|
srl a
|
||||||
rr b
|
rr b
|
||||||
srl a
|
srl a
|
||||||
rr b ; max hp / 4
|
rr b ; max hp / 4
|
||||||
|
|
@ -27,29 +27,29 @@ SubstituteEffect_: ; 17dad (5:7dad)
|
||||||
ld de, wBattleMonHP - wBattleMonMaxHP
|
ld de, wBattleMonHP - wBattleMonMaxHP
|
||||||
add hl, de ; point hl to current HP low byte
|
add hl, de ; point hl to current HP low byte
|
||||||
pop de
|
pop de
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [de], a ; save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
ld [de], a ; save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
; subtract [max hp / 4] to current HP
|
; subtract [max hp / 4] to current HP
|
||||||
sub b
|
sub b
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
sbc 0
|
sbc 0
|
||||||
pop bc
|
pop bc
|
||||||
jr c, .notEnoughHP ; underflow means user would be left with negative health
|
jr c, .notEnoughHP ; underflow means user would be left with negative health
|
||||||
; bug: since it only brances on carry, it will possibly leave user with 0 HP
|
; bug: since it only brances on carry, it will possibly leave user with 0 HP
|
||||||
.userHasZeroOrMoreHP
|
.userHasZeroOrMoreHP
|
||||||
ldi [hl], a ; save resulting HP after substraction into current HP
|
ldi [hl], a ; save resulting HP after substraction into current HP
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
ld h, b
|
ld h, b
|
||||||
ld l, c
|
ld l, c
|
||||||
set HasSubstituteUp, [hl]
|
set HasSubstituteUp, [hl]
|
||||||
ld a, [W_OPTIONS]
|
ld a, [W_OPTIONS]
|
||||||
bit 7, a ; battle animation is enabled?
|
bit 7, a ; battle animation is enabled?
|
||||||
ld hl, PlayCurrentMoveAnimation
|
ld hl, PlayCurrentMoveAnimation
|
||||||
ld b, BANK(PlayCurrentMoveAnimation)
|
ld b, BANK(PlayCurrentMoveAnimation)
|
||||||
jr z, .animationEnabled
|
jr z, .animationEnabled
|
||||||
ld hl, AnimationSubstitute
|
ld hl, AnimationSubstitute
|
||||||
ld b, BANK(AnimationSubstitute)
|
ld b, BANK(AnimationSubstitute)
|
||||||
.animationEnabled
|
.animationEnabled
|
||||||
call Bankswitch ; jump to routine depending on animation setting
|
call Bankswitch ; jump to routine depending on animation setting
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
ld hl, W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
.transformEffect
|
.transformEffect
|
||||||
; animation(s) played are different if target has Substitute up
|
; animation(s) played are different if target has Substitute up
|
||||||
bit HasSubstituteUp, [hl]
|
bit HasSubstituteUp, [hl]
|
||||||
push af
|
push af
|
||||||
ld hl, Func_79747
|
ld hl, Func_79747
|
||||||
ld b, BANK(Func_79747)
|
ld b, BANK(Func_79747)
|
||||||
|
|
@ -49,13 +49,13 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
push hl
|
push hl
|
||||||
; transform user into opposing Pokemon
|
; transform user into opposing Pokemon
|
||||||
; species
|
; species
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
; type 1, type 2, catch rate, and moves
|
; type 1, type 2, catch rate, and moves
|
||||||
ld bc, $5
|
ld bc, $5
|
||||||
add hl, bc
|
add hl, bc
|
||||||
inc de
|
inc de
|
||||||
inc de
|
inc de
|
||||||
inc de
|
inc de
|
||||||
|
|
@ -82,7 +82,7 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
; Attack, Defense, Speed, and Special stats
|
; Attack, Defense, Speed, and Special stats
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
|
|
@ -91,7 +91,7 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
inc de
|
inc de
|
||||||
ld bc, $8
|
ld bc, $8
|
||||||
call CopyData
|
call CopyData
|
||||||
ld bc, wBattleMonMoves - wBattleMonPP
|
ld bc, wBattleMonMoves - wBattleMonPP
|
||||||
add hl, bc ; ld hl, wBattleMonMoves
|
add hl, bc ; ld hl, wBattleMonMoves
|
||||||
ld b, NUM_MOVES
|
ld b, NUM_MOVES
|
||||||
.copyPPLoop
|
.copyPPLoop
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ ReadTrainer: ; 39c53 (e:5c53)
|
||||||
ld [wEnemyMon6Moves + 2],a
|
ld [wEnemyMon6Moves + 2],a
|
||||||
.FinishUp
|
.FinishUp
|
||||||
; clear wAmountMoneyWon addresses
|
; clear wAmountMoneyWon addresses
|
||||||
xor a
|
xor a
|
||||||
ld de,wAmountMoneyWon
|
ld de,wAmountMoneyWon
|
||||||
ld [de],a
|
ld [de],a
|
||||||
inc de
|
inc de
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ StatusAilmentMoveEffects ; 57e2
|
||||||
; that fall in-bewteen
|
; that fall in-bewteen
|
||||||
AIMoveChoiceModification2: ; 397e7 (e:57e7)
|
AIMoveChoiceModification2: ; 397e7 (e:57e7)
|
||||||
ld a, [wAILayer2Encouragement]
|
ld a, [wAILayer2Encouragement]
|
||||||
cp $1
|
cp $1
|
||||||
ret nz
|
ret nz
|
||||||
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offset)
|
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offset)
|
||||||
ld de, wEnemyMonMoves ; enemy moves
|
ld de, wEnemyMonMoves ; enemy moves
|
||||||
|
|
@ -325,8 +325,8 @@ TrainerClassMoveChoiceModifications: ; 3989b (e:589b)
|
||||||
db 1,3,0 ; LANCE
|
db 1,3,0 ; LANCE
|
||||||
|
|
||||||
INCLUDE "engine/battle/trainer_pic_money_pointers.asm"
|
INCLUDE "engine/battle/trainer_pic_money_pointers.asm"
|
||||||
|
|
||||||
INCLUDE "text/trainer_names.asm"
|
INCLUDE "text/trainer_names.asm"
|
||||||
|
|
||||||
INCLUDE "engine/battle/bank_e_misc.asm"
|
INCLUDE "engine/battle/bank_e_misc.asm"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ TryDoWildEncounter: ; 13870 (4:7870)
|
||||||
jr z, .lastRepelStep
|
jr z, .lastRepelStep
|
||||||
ld [wRepelRemainingSteps], a
|
ld [wRepelRemainingSteps], a
|
||||||
.asm_1389e
|
.asm_1389e
|
||||||
; determine if wild pokemon can appear in the half-block we're standing in
|
; determine if wild pokemon can appear in the half-block we're standing in
|
||||||
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
|
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
|
||||||
hlCoord 9, 9
|
hlCoord 9, 9
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
|
|
@ -64,12 +64,12 @@ TryDoWildEncounter: ; 13870 (4:7870)
|
||||||
; determine which wild pokemon (grass or water) can appear in the half-block we're standing in
|
; determine which wild pokemon (grass or water) can appear in the half-block we're standing in
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld hl, W_GRASSMONS
|
ld hl, W_GRASSMONS
|
||||||
aCoord 8, 9
|
aCoord 8, 9
|
||||||
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
|
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
|
||||||
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
||||||
ld hl, W_WATERMONS
|
ld hl, W_WATERMONS
|
||||||
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
||||||
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
|
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
|
||||||
.gotWildEncounterType
|
.gotWildEncounterType
|
||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue