diff options
author | U-Daniel-PC\Daniel <corrnondacqb@yahoo.com> | 2015-06-11 17:41:33 -0500 |
---|---|---|
committer | U-Daniel-PC\Daniel <corrnondacqb@yahoo.com> | 2015-06-11 17:41:33 -0500 |
commit | 39abace5694abf22efcd3efe2feaa0e03ec56b4b (patch) | |
tree | 72d9e8693da0694beaef9171917170c422e6f4e6 | |
parent | c43c338a5f7d90494b7e6e67c6533288bd28117d (diff) |
Clean up white space
-rwxr-xr-x | constants/status_constants.asm | 6 | ||||
-rwxr-xr-x | engine/battle/core.asm | 86 | ||||
-rw-r--r-- | engine/battle/decrement_pp.asm | 16 | ||||
-rw-r--r-- | engine/battle/init_battle_variables.asm | 4 | ||||
-rw-r--r-- | engine/battle/moveEffects/conversion_effect.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/drain_hp_effect.asm | 10 | ||||
-rw-r--r-- | engine/battle/moveEffects/haze_effect.asm | 10 | ||||
-rw-r--r-- | engine/battle/moveEffects/heal_effect.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/leech_seed_effect.asm | 14 | ||||
-rw-r--r-- | engine/battle/moveEffects/one_hit_ko_effect.asm | 8 | ||||
-rw-r--r-- | engine/battle/moveEffects/paralyze_effect.asm | 4 | ||||
-rw-r--r-- | engine/battle/moveEffects/pay_day_effect.asm | 6 | ||||
-rw-r--r-- | engine/battle/moveEffects/recoil_effect.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/substitute_effect.asm | 26 | ||||
-rw-r--r-- | engine/battle/moveEffects/transform_effect.asm | 14 | ||||
-rwxr-xr-x | engine/battle/read_trainer_party.asm | 2 | ||||
-rw-r--r-- | engine/battle/trainer_ai.asm | 6 | ||||
-rw-r--r-- | engine/battle/wild_encounters.asm | 8 | ||||
-rwxr-xr-x | wram.asm | 2 |
19 files changed, 114 insertions, 114 deletions
diff --git a/constants/status_constants.asm b/constants/status_constants.asm index e19973a0..d9be6250 100755 --- a/constants/status_constants.asm +++ b/constants/status_constants.asm @@ -1,4 +1,4 @@ -; non-volatile statuses +; non-volatile statuses SLP EQU %111 ; sleep counter PSN EQU 3 BRN EQU 4 @@ -13,7 +13,7 @@ Flinched EQU 3 ChargingUp EQU 4 ; e.g. Solar Beam, Fly UsingTrappingMove EQU 5 ; e.g. Wrap Invulnerable EQU 6 ; charging up Fly/Dig -Confused EQU 7 +Confused EQU 7 ; volatile statuses 2 UsingXAccuracy EQU 0 @@ -26,7 +26,7 @@ UsingRage EQU 6 Seeded EQU 7 ; volatile statuses 3 -BadlyPoisoned EQU 0 +BadlyPoisoned EQU 0 HasLightScreenUp EQU 1 HasReflectUp EQU 2 Transformed EQU 3 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 04a6de1c..b61a2220 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1023,7 +1023,7 @@ TrainerBattleVictory: ; 3c696 (f:4696) ld c, $28 call DelayFrames call PrintEndBattleText -; win money +; win money ld hl, MoneyForWinningText call PrintText ld de, wPlayerMoney + 2 @@ -1642,7 +1642,7 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9) ld b, a ld a, [H_QUOTIENT + 3] 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 ; can't escape ld a, $1 @@ -2930,8 +2930,8 @@ PrintMenuItem: ; 3d4b6 (f:54b6) ld c, a 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 - ld a, [hl] - ld [wPlayerSelectedMove], a ; update wPlayerSelectedMove even if the move + ld a, [hl] + ld [wPlayerSelectedMove], a ; update wPlayerSelectedMove even if the move ; isn't actually selected (just pointed to by the cursor) ld a, [wPlayerMonNumber] ld [wWhichPokemon], a @@ -2947,7 +2947,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6) ld a, [hl] and $3f ld [wcd6d], a -; print TYPE/<type> and <curPP>/<maxPP> +; print TYPE/<type> and <curPP>/<maxPP> hlCoord 1, 9 ld de, TypeText call PlaceString @@ -2963,7 +2963,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6) ld de, wd11e ld bc, $102 call PrintNumber - call GetCurrentMove + call GetCurrentMove hlCoord 2, 10 predef PrintMoveType .moveDisabled @@ -3174,13 +3174,13 @@ PlayerCanExecuteMove: ; 3d6b0 (f:56b0) ld hl,ResidualEffects1 ld de,1 call IsInArray - jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests - ; unless executed as part of their exclusive effect functions + jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests + ; unless executed as part of their exclusive effect functions ld a,[W_PLAYERMOVEEFFECT] ld hl,SpecialEffectsCont ld de,1 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) ld a,[W_PLAYERMOVEEFFECT] ld hl,SetDamageEffects @@ -3203,7 +3203,7 @@ handleIfPlayerMoveMissed and a jr z,getPlayerAnimationType 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 playerCheckIfFlyOrChargeEffect getPlayerAnimationType @@ -3298,7 +3298,7 @@ MirrorMoveCheck ld a,[wPlayerNumAttacksLeft] dec 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 res AttackingMultipleTimes,[hl] ; clear attacking multiple times status when all attacks are over ld hl,MultiHitText @@ -3509,8 +3509,8 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854) .MonHurtItselfOrFullyParalysed ld hl,W_PLAYERBATTSTATUS1 ld a,[hl] - ; 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)) + ; 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)) ld [hl],a ld a,[W_PLAYERMOVEEFFECT] cp a,FLY_EFFECT @@ -3588,7 +3588,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854) ld hl,wPlayerNumAttacksLeft dec [hl] ; did Thrashing About counter hit 0? ld hl,PlayerCalcMoveDamage ; skip DecrementPP - jp nz,.returnToHL + jp nz,.returnToHL push hl ld hl,W_PLAYERBATTSTATUS1 res ThrashingAbout,[hl] ; no longer thrashing about @@ -3609,7 +3609,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854) ld a,[wPlayerNumAttacksLeft] dec a ; did multi-turn move end? 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 jp nz,.returnToHL jp .returnToHL @@ -3706,7 +3706,7 @@ PrintMoveIsDisabledText: ; 3da88 (f:5a88) ld de, W_ENEMYBATTSTATUS1 .removeChargingUp ld a, [de] - res ChargingUp, a ; end the pokemon's + res ChargingUp, a ; end the pokemon's ld [de], a ld a, [hl] 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 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. ld a, [hli] ld b, [hl] @@ -4776,7 +4776,7 @@ HandleCounterMove: ; 3e093 (f:6093) ld a,[hli] 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. - ; 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 it did damage, double it ld a,[hl] @@ -5037,9 +5037,9 @@ ApplyAttackToPlayerPokemonDone AttackSubstitute: ; 3e25e (f:625e) ; 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. -; 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. -; 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. ld hl,SubstituteTookDamageText @@ -5064,7 +5064,7 @@ AttackSubstitute: ; 3e25e (f:625e) ld [de],a ret nc .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. ld h,b ld l,c @@ -6023,7 +6023,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f) .monHurtItselfOrFullyParalysed ld hl, W_ENEMYBATTSTATUS1 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)) ld [hl], a ld a, [W_ENEMYMOVEEFFECT] @@ -6119,7 +6119,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f) call PrintText ld hl, wEnemyNumAttacksLeft 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 jp nz, .enemyReturnToHL jp .enemyReturnToHL @@ -6753,8 +6753,8 @@ BattleRandom: push hl push bc 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 ld [wLinkBattleRandomNumberListIndex], a @@ -6763,11 +6763,11 @@ BattleRandom: .loop ld a, [hl] ld c, a -; multiply by 5 +; multiply by 5 add a add a add c -; add 1 +; add 1 inc a ld [hli], a dec b @@ -7052,7 +7052,7 @@ asm_3f0d0: ; 3f0d0 (f:70d0) dec b jr nz, .asm_3f0de ret - + .asm_3f0ed push bc ld b, $0 @@ -7604,17 +7604,17 @@ StatModifierUpEffect: ; 3f428 (f:7428) add hl, bc pop bc xor a - ld [H_MULTIPLICAND], a + ld [H_MULTIPLICAND], a ld a, [de] ld [H_MULTIPLICAND + 1], a inc de ld a, [de] ld [H_MULTIPLICAND + 2], a ld a, [hli] - ld [H_MULTIPLIER], a + ld [H_MULTIPLIER], a call Multiply ld a, [hl] - ld [H_DIVISOR], a + ld [H_DIVISOR], a ld b, $4 call Divide pop hl @@ -7822,17 +7822,17 @@ StatModifierDownEffect: ; 3f54c (f:754c) add hl, bc pop bc xor a - ld [H_MULTIPLICAND], a + ld [H_MULTIPLICAND], a ld a, [de] ld [H_MULTIPLICAND + 1], a inc de ld a, [de] ld [H_MULTIPLICAND + 2], a ld a, [hli] - ld [H_MULTIPLIER], a + ld [H_MULTIPLIER], a call Multiply ld a, [hl] - ld [H_DIVISOR], a + ld [H_DIVISOR], a ld b, $4 call Divide pop hl @@ -8287,8 +8287,8 @@ TrappingEffect: ; 3f917 (f:7917) .trappingEffect bit UsingTrappingMove, [hl] ret nz - 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 + 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 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 and $3 @@ -8346,7 +8346,7 @@ ConfusionSideEffectSuccess: ; 3f96f (f:796f) set Confused, [hl] ; mon is now confused push af call BattleRandom - and $3 + and $3 inc a inc a ld [bc], a ; confusion status will last 2-5 turns @@ -8527,12 +8527,12 @@ DisableEffect: ; 3fa8a (f:7a8a) ld a, [H_WHOSETURN] and a ld hl, wBattleMonPP - jr nz, .enemyTurn + jr nz, .enemyTurn ld a, [wLinkState] cp LINK_STATE_BATTLING pop hl ; wEnemyMonMoves jr nz, .playerTurnNotLinkBattle -; .playerTurnLinkBattle +; .playerTurnLinkBattle push hl ld hl, wEnemyMonPP .enemyTurn @@ -8557,7 +8557,7 @@ DisableEffect: ; 3fa8a (f:7a8a) and $7 inc a ; 1-8 turns 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 ld [de], a call PlayCurrentMoveAnimation2 @@ -8568,7 +8568,7 @@ DisableEffect: ; 3fa8a (f:7a8a) inc hl ; wEnemyDisabledMoveNumber .printDisableText ld a, [wd11e] ; move number - ld [hl], a + ld [hl], a call GetMoveName ld hl, MoveWasDisabledText jp PrintText @@ -8659,12 +8659,12 @@ ParalyzedMayNotAttackText: ; 3fb74 (f:7b74) CheckTargetSubstitute: ; 3fb79 (f:7b79) push hl ld hl, W_ENEMYBATTSTATUS2 - ld a, [H_WHOSETURN] + ld a, [H_WHOSETURN] and a jr z, .next1 ld hl, W_PLAYERBATTSTATUS2 .next1 - bit HasSubstituteUp, [hl] + bit HasSubstituteUp, [hl] pop hl ret diff --git a/engine/battle/decrement_pp.asm b/engine/battle/decrement_pp.asm index ecf5040b..7345c5c1 100644 --- a/engine/battle/decrement_pp.asm +++ b/engine/battle/decrement_pp.asm @@ -9,15 +9,15 @@ DecrementPP: ; 68000 (1a:4000) ; W_PLAYERBATTSTATUS2 status flags later and a, (1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << AttackingMultipleTimes) 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 ld hl, wBattleMonPP ; PP of first move (in battle) - -; decrement PP in the battle struct - call .DecrementPP - -; decrement PP in the party struct - ld a, [W_PLAYERBATTSTATUS3] + +; decrement PP in the battle struct + call .DecrementPP + +; decrement PP in the party struct + ld a, [W_PLAYERBATTSTATUS3] bit Transformed, a ret nz ; Return if transformed. Pokemon Red stores the "current pokemon's" PP ; 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 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 .DecrementPP ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use? diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 457cc4e1..edb1f13e 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -13,7 +13,7 @@ InitBattleVariables: ; 525af (14:65af) ld [wCriticalHitOrOHKO], a ld [wBattleMonSpecies], a ld [wPartyGainExpFlags], a - ld [wPlayerMonNumber], a + ld [wPlayerMonNumber], a ld [wEscapedFromBattle], a ld [wMapPalOffset], a ld hl, wcf1d @@ -27,7 +27,7 @@ InitBattleVariables: ; 525af (14:65af) jr nz, .loop inc a ld [wccd9], a - ld a, [W_CURMAP] + ld a, [W_CURMAP] cp SAFARI_ZONE_EAST jr c, .notSafariBattle cp SAFARI_ZONE_REST_HOUSE_1 diff --git a/engine/battle/moveEffects/conversion_effect.asm b/engine/battle/moveEffects/conversion_effect.asm index 2f05afb3..e4c5b4bd 100644 --- a/engine/battle/moveEffects/conversion_effect.asm +++ b/engine/battle/moveEffects/conversion_effect.asm @@ -13,7 +13,7 @@ ConversionEffect_: ; 139a3 (4:79a3) .conversionEffect bit Invulnerable, a ; is mon immune to typical attacks (dig/fly) jr nz, PrintButItFailedText -; copy target's types to user +; copy target's types to user ld a, [hli] ld [de], a inc de diff --git a/engine/battle/moveEffects/drain_hp_effect.asm b/engine/battle/moveEffects/drain_hp_effect.asm index 517d53d1..be52e76d 100644 --- a/engine/battle/moveEffects/drain_hp_effect.asm +++ b/engine/battle/moveEffects/drain_hp_effect.asm @@ -1,5 +1,5 @@ DrainHPEffect_: ; 783f (1:783f) - ld hl, W_DAMAGE + ld hl, W_DAMAGE ld a, [hl] srl a ; divide damage by 2 ld [hli], a @@ -17,8 +17,8 @@ DrainHPEffect_: ; 783f (1:783f) ld a, [H_WHOSETURN] and a jp z, .addDamageToAttackerHP - ld hl, wEnemyMonHP - ld de, wEnemyMonMaxHP + ld hl, wEnemyMonHP + ld de, wEnemyMonMaxHP .addDamageToAttackerHP ld bc, wHPBarOldHP+1 ; copy current HP to wHPBarOldHP @@ -41,7 +41,7 @@ DrainHPEffect_: ; 783f (1:783f) add b ld [hld], a ld [wHPBarNewHP], a - ld a, [W_DAMAGE] + ld a, [W_DAMAGE] ld b, [hl] adc b ld [hli], a @@ -87,7 +87,7 @@ DrainHPEffect_: ; 783f (1:783f) and a ld a, [W_PLAYERMOVEEFFECT] jr z, .next3 - ld a, [W_ENEMYMOVEEFFECT] + ld a, [W_ENEMYMOVEEFFECT] .next3 cp DREAM_EATER_EFFECT jr nz, .printText diff --git a/engine/battle/moveEffects/haze_effect.asm b/engine/battle/moveEffects/haze_effect.asm index 14b5f5dd..5c5443c0 100644 --- a/engine/battle/moveEffects/haze_effect.asm +++ b/engine/battle/moveEffects/haze_effect.asm @@ -1,11 +1,11 @@ HazeEffect_: ; 139da (4:79da) ld a, $7 -; store 7 on every stat mod +; store 7 on every stat mod ld hl, wPlayerMonAttackMod call ResetStatMods ld hl, wEnemyMonAttackMod call ResetStatMods -; copy unmodified stats to battle stats +; copy unmodified stats to battle stats ld hl, wPlayerMonUnmodifiedAttack ld de, wBattleMonAttack call ResetStats @@ -25,7 +25,7 @@ HazeEffect_: ; 139da (4:79da) ld [hl], $0 and SLP | (1 << FRZ) 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 [de], a @@ -51,7 +51,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37) inc hl ; BATTSTATUS2 ld a, [hl] ; 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 a, [hl] and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses @@ -61,7 +61,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37) ResetStatMods: ; 13a43 (4:7a43) ld b, $8 .loop - ld [hli], a + ld [hli], a dec b jr nz, .loop ret diff --git a/engine/battle/moveEffects/heal_effect.asm b/engine/battle/moveEffects/heal_effect.asm index 862917f7..d9729747 100644 --- a/engine/battle/moveEffects/heal_effect.asm +++ b/engine/battle/moveEffects/heal_effect.asm @@ -76,7 +76,7 @@ HealEffect_: ; 3b9ec (e:79ec) ld a, [de] sbc [hl] 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 [de], a ld [wHPBarNewHP+1], a diff --git a/engine/battle/moveEffects/leech_seed_effect.asm b/engine/battle/moveEffects/leech_seed_effect.asm index e29fd7c2..284ca2c0 100644 --- a/engine/battle/moveEffects/leech_seed_effect.asm +++ b/engine/battle/moveEffects/leech_seed_effect.asm @@ -1,20 +1,20 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9) callab MoveHitTest - ld a, [W_MOVEMISSED] + ld a, [W_MOVEMISSED] and a jr nz, .moveMissed - ld hl, W_ENEMYBATTSTATUS2 - ld de, wEnemyMonType1 - ld a, [H_WHOSETURN] + ld hl, W_ENEMYBATTSTATUS2 + ld de, wEnemyMonType1 + ld a, [H_WHOSETURN] and a jr z, .leechSeedEffect - ld hl, W_PLAYERBATTSTATUS2 - ld de, wBattleMonType1 + ld hl, W_PLAYERBATTSTATUS2 + ld de, wBattleMonType1 .leechSeedEffect ; miss if the target is grass-type or already seeded ld a, [de] cp GRASS - jr z, .moveMissed + jr z, .moveMissed inc de ld a, [de] cp GRASS diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm index cc0eca7b..907db80c 100644 --- a/engine/battle/moveEffects/one_hit_ko_effect.asm +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -1,5 +1,5 @@ OneHitKOEffect_: ; 33f57 (c:7f57) - ld hl, W_DAMAGE + ld hl, W_DAMAGE xor a ld [hli], a ld [hl], a ; set the damage output to zero @@ -7,7 +7,7 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld [wCriticalHitOrOHKO], a ld hl, wBattleMonSpeed + 1 ld de, wEnemyMonSpeed + 1 - ld a, [H_WHOSETURN] + ld a, [H_WHOSETURN] and a jr z, .compareSpeed ld hl, wEnemyMonSpeed + 1 @@ -24,7 +24,7 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld a, [hl] sbc b jr c, .userIsSlower - ld hl, W_DAMAGE + ld hl, W_DAMAGE ld a, $ff ld [hli], a ld [hl], a @@ -34,5 +34,5 @@ OneHitKOEffect_: ; 33f57 (c:7f57) .userIsSlower ; keep damage at 0 and set move missed flag if target's current speed is higher instead ld a, $1 - ld [W_MOVEMISSED], a + ld [W_MOVEMISSED], a ret diff --git a/engine/battle/moveEffects/paralyze_effect.asm b/engine/battle/moveEffects/paralyze_effect.asm index 69acbb01..b88e6479 100644 --- a/engine/battle/moveEffects/paralyze_effect.asm +++ b/engine/battle/moveEffects/paralyze_effect.asm @@ -4,7 +4,7 @@ ParalyzeEffect_: ; 52601 (14:6601) ld a, [H_WHOSETURN] and a jp z, .next - ld hl, wBattleMonStatus + ld hl, wBattleMonStatus ld de, W_ENEMYMOVETYPE .next ld a, [hl] @@ -28,7 +28,7 @@ ParalyzeEffect_: ; 52601 (14:6601) push hl callab MoveHitTest pop hl - ld a, [W_MOVEMISSED] + ld a, [W_MOVEMISSED] and a jr nz, .didntAffect set PAR, [hl] diff --git a/engine/battle/moveEffects/pay_day_effect.asm b/engine/battle/moveEffects/pay_day_effect.asm index fc937d1b..26e69ef5 100644 --- a/engine/battle/moveEffects/pay_day_effect.asm +++ b/engine/battle/moveEffects/pay_day_effect.asm @@ -9,19 +9,19 @@ PayDayEffect_ ; 2feb8 (b:7eb8) ld a, [wEnemyMonLevel] .payDayEffect ; level * 2 - add a + add a ld [H_DIVIDEND + 3], a xor a ld [H_DIVIDEND], a ld [H_DIVIDEND + 1], a ld [H_DIVIDEND + 2], a -; convert to BCD +; convert to BCD ld a, 100 ld [H_DIVISOR], a ld b, $4 call Divide ld a, [H_QUOTIENT + 3] - ld [hli], a + ld [hli], a ld a, [H_REMAINDER] ld [H_DIVIDEND + 3], a ld a, 10 diff --git a/engine/battle/moveEffects/recoil_effect.asm b/engine/battle/moveEffects/recoil_effect.asm index fe516c03..95b54922 100644 --- a/engine/battle/moveEffects/recoil_effect.asm +++ b/engine/battle/moveEffects/recoil_effect.asm @@ -46,7 +46,7 @@ RecoilEffect_: ; 1392c (4:792c) ld [wHPBarNewHP+1], a jr nc, .getHPBarCoords ; if recoil damage is higher than the Pokemon's HP, set its HP to 0 - xor a + xor a ld [hli], a ld [hl], a ld hl, wHPBarNewHP diff --git a/engine/battle/moveEffects/substitute_effect.asm b/engine/battle/moveEffects/substitute_effect.asm index 8412e281..444c755b 100644 --- a/engine/battle/moveEffects/substitute_effect.asm +++ b/engine/battle/moveEffects/substitute_effect.asm @@ -11,15 +11,15 @@ SubstituteEffect_: ; 17dad (5:7dad) ld de, wEnemySubstituteHP ld bc, W_ENEMYBATTSTATUS2 .notEnemy - ld a, [bc] + ld a, [bc] bit HasSubstituteUp, a ; user already has substitute? - jr nz, .alreadyHasSubstitute + jr nz, .alreadyHasSubstitute ; quarter health to remove from user -; assumes max HP is 1023 or lower +; assumes max HP is 1023 or lower push bc ld a, [hli] ld b, [hl] - srl a + srl a rr b srl a rr b ; max hp / 4 @@ -27,29 +27,29 @@ SubstituteEffect_: ; 17dad (5:7dad) ld de, wBattleMonHP - wBattleMonMaxHP add hl, de ; point hl to current HP low byte 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 a, [hld] -; subtract [max hp / 4] to current HP - sub b +; subtract [max hp / 4] to current HP + sub b ld d, a ld a, [hl] - sbc 0 + sbc 0 pop bc 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 .userHasZeroOrMoreHP ldi [hl], a ; save resulting HP after substraction into current HP - ld [hl], d + ld [hl], d ld h, b ld l, c - set HasSubstituteUp, [hl] - ld a, [W_OPTIONS] + set HasSubstituteUp, [hl] + ld a, [W_OPTIONS] bit 7, a ; battle animation is enabled? - ld hl, PlayCurrentMoveAnimation + ld hl, PlayCurrentMoveAnimation ld b, BANK(PlayCurrentMoveAnimation) jr z, .animationEnabled - ld hl, AnimationSubstitute + ld hl, AnimationSubstitute ld b, BANK(AnimationSubstitute) .animationEnabled call Bankswitch ; jump to routine depending on animation setting diff --git a/engine/battle/moveEffects/transform_effect.asm b/engine/battle/moveEffects/transform_effect.asm index 6504bf03..1b992df6 100644 --- a/engine/battle/moveEffects/transform_effect.asm +++ b/engine/battle/moveEffects/transform_effect.asm @@ -24,7 +24,7 @@ TransformEffect_: ; 3bab1 (e:7ab1) ld hl, W_ENEMYBATTSTATUS2 .transformEffect ; animation(s) played are different if target has Substitute up - bit HasSubstituteUp, [hl] + bit HasSubstituteUp, [hl] push af ld hl, Func_79747 ld b, BANK(Func_79747) @@ -49,13 +49,13 @@ TransformEffect_: ; 3bab1 (e:7ab1) pop de pop hl push hl -; transform user into opposing Pokemon +; transform user into opposing Pokemon ; species - ld a, [hl] + ld a, [hl] ld [de], a -; type 1, type 2, catch rate, and moves +; type 1, type 2, catch rate, and moves ld bc, $5 - add hl, bc + add hl, bc inc de inc de inc de @@ -82,7 +82,7 @@ TransformEffect_: ; 3bab1 (e:7ab1) ld a, [hli] ld [de], a inc de -; Attack, Defense, Speed, and Special stats +; Attack, Defense, Speed, and Special stats inc hl inc hl inc hl @@ -91,7 +91,7 @@ TransformEffect_: ; 3bab1 (e:7ab1) inc de ld bc, $8 call CopyData - ld bc, wBattleMonMoves - wBattleMonPP + ld bc, wBattleMonMoves - wBattleMonPP add hl, bc ; ld hl, wBattleMonMoves ld b, NUM_MOVES .copyPPLoop diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index d8da714e..e373ef93 100755 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -143,7 +143,7 @@ ReadTrainer: ; 39c53 (e:5c53) ld [wEnemyMon6Moves + 2],a .FinishUp ; clear wAmountMoneyWon addresses - xor a + xor a ld de,wAmountMoneyWon ld [de],a inc de diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 19a184f2..8edf1920 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -157,7 +157,7 @@ StatusAilmentMoveEffects ; 57e2 ; that fall in-bewteen AIMoveChoiceModification2: ; 397e7 (e:57e7) ld a, [wAILayer2Encouragement] - cp $1 + cp $1 ret nz ld hl, wBuffer - 1 ; temp move selection array (-1 byte offset) ld de, wEnemyMonMoves ; enemy moves @@ -325,8 +325,8 @@ TrainerClassMoveChoiceModifications: ; 3989b (e:589b) db 1,3,0 ; LANCE 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" diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 61b318b9..87512583 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -23,7 +23,7 @@ TryDoWildEncounter: ; 13870 (4:7870) jr z, .lastRepelStep ld [wRepelRemainingSteps], a .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? hlCoord 9, 9 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 ld c, [hl] ld hl, W_GRASSMONS - aCoord 8, 9 - cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile? + aCoord 8, 9 + 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 ld hl, W_WATERMONS ; 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 ld b, $0 add hl, bc @@ -468,7 +468,7 @@ ds 10 wInGameTradeGiveMonSpecies:: ; cd0f -wPlayerMonUnmodifiedLevel:: ; cd0f +wPlayerMonUnmodifiedLevel:: ; cd0f ds 1 wInGameTradeTextPointerTablePointer:: ; cd10 |