shithub: pokered

Download patch

ref: 49a25618ea7316741b7838f111da311ba66a381c
parent: 01095f77943b9a7fd0432a6ad2e5c18f2d3e66ae
author: U-Daniel-PC\Daniel <corrnondacqb@yahoo.com>
date: Thu Jan 22 17:05:13 EST 2015

Clean up white space, fix label typo

--- a/data/mapHeaders/beach_house.asm
+++ b/data/mapHeaders/beach_house.asm
@@ -1,4 +1,4 @@
-BeachHouse_h: 
+BeachHouse_h:
 
 	db BEACH_HOUSE_TILESET
 	db BEACH_HOUSE_HEIGHT, BEACH_HOUSE_WIDTH ; dimensions (y, x)
--- a/data/wildPokemon/viridianforest.asm
+++ b/data/wildPokemon/viridianforest.asm
@@ -33,7 +33,7 @@
 			db 4,KAKUNA
 			db 3,WEEDLE
 		ENDC
-	
+
 		db 3,PIKACHU
 		db 5,PIKACHU
 	ENDC
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -71,7 +71,7 @@
 	db -1
 SpecialEffects: ; 3c03b (f:403b)
 ; Effects from arrays 2, 4, and 5B, minus Twineedle and Rage.
-; Includes all effects that do not need to be called at the end of 
+; Includes all effects that do not need to be called at the end of
 ; ExecutePlayerMove (or ExecuteEnemyMove), because they have already been handled
 	db DRAIN_HP_EFFECT
 	db EXPLODE_EFFECT
@@ -512,7 +512,7 @@
 	ret nz ; if so, return
 	ld a, b
 	and a
-	jp z, HandlePlayerMonFainted 
+	jp z, HandlePlayerMonFainted
 .AIActionUsedEnemyFirst
 	call HandlePoisonBurnLeechSeed
 	jp z, HandleEnemyMonFainted
@@ -1595,7 +1595,7 @@
 	call StringCmp
 	jr nc, .canEscape ; jump if player speed greater than enemy speed
 	xor a
-	ld [H_MULTIPLICAND], a 
+	ld [H_MULTIPLICAND], a
 	ld a, 32
 	ld [H_MULTIPLIER], a
 	call Multiply ; multiply player speed by 32
@@ -1914,7 +1914,7 @@
 	ld a, [wcf98]
 	ld [wcf91], a
 	hlCoord 10, 9
-	predef DrawHP 
+	predef DrawHP
 	ld a, $1
 	ld [H_AUTOBGTRANSFERENABLED], a
 	ld hl, wcf1d
@@ -3160,19 +3160,19 @@
 	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
 CalcMoveDamage: ; 3d6dc (f:56dc)
 	ld a,[W_PLAYERMOVEEFFECT]
 	ld hl,SetDamageEffects
 	ld de,1
-	call IsInArray 
-	jp c,.moveHitTest ; SetDamageEffects moves (e.g. Seismic Toss and Super Fang) skip damage calculation 
+	call IsInArray
+	jp c,.moveHitTest ; SetDamageEffects moves (e.g. Seismic Toss and Super Fang) skip damage calculation
 	call CriticalHitTest
 	call HandleCounterMove
 	jr z,asm_3d705
@@ -3191,7 +3191,7 @@
 	ld a,[W_PLAYERMOVEEFFECT]
 	sub a,7 ; Explosion effect
 	jr z,asm_3d71e ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT
-	jr asm_3d74b 
+	jr asm_3d74b
 asm_3d714
 	ld a,[W_PLAYERMOVEEFFECT]
 	and a
@@ -3198,7 +3198,7 @@
 	ld a,4
 	jr z,asm_3d71e
 	ld a,5
-asm_3d71e 
+asm_3d71e
 	push af
 	ld a,[W_PLAYERBATTSTATUS2]
 	bit 4,a
@@ -3258,7 +3258,7 @@
 	ld a,[W_PLAYERMOVEEFFECT]
 	cp a,EXPLODE_EFFECT ; even if Explosion or Selfdestruct missed, its effect still needs to be activated
 	jr z,.notDone
-	jp ExecutePlayerMoveDone ; otherwise, we're done if the move missed 
+	jp ExecutePlayerMoveDone ; otherwise, we're done if the move missed
 .moveDidNotMiss
 	call ApplyAttackToEnemyPokemon
 	call PrintCriticalOHKOText
@@ -3284,13 +3284,13 @@
 	ld a,[wPlayerNumAttacksLeft]
 	dec a
 	ld [wPlayerNumAttacksLeft],a
-	jp nz,asm_3d714 ; for multi-hit moves, apply attack until PlayerNumAttacksLeft hits 0 or the enemy faints. 
+	jp nz,asm_3d714 ; 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 2,[hl]
 	ld hl,MultiHitText
 	call PrintText
 	xor a
-	ld [W_NUMHITS],a 
+	ld [W_NUMHITS],a
 .executeOtherEffects
 	ld a,[W_PLAYERMOVEEFFECT]
 	and a
@@ -3573,7 +3573,7 @@
 	ld hl,wPlayerNumAttacksLeft
 	dec [hl] ; did Trashing About counter hit 0?
 	ld hl,CalcMoveDamage ; skip DecrementPP
-	jp nz,.returnToHL 
+	jp nz,.returnToHL
 	push hl
 	ld hl,W_PLAYERBATTSTATUS1
 	res 1,[hl] ; no longer trashing about
@@ -4212,7 +4212,7 @@
 	jr z, .physicalAttackCritCheck
 ; if the enemy has used Reflect, double the enemy's defense
 	sla c
-	rl b	
+	rl b
 .physicalAttackCritCheck
 	ld hl, wBattleMonAttack
 	ld a, [wCriticalHitOrOHKO]
@@ -4244,7 +4244,7 @@
 	sla c
 	rl b
 ; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if
-; a Pokemon with 512 or more Defense has ued Reflect, or if a Pokemon with 512 or more Special has used Light Screen 	
+; a Pokemon with 512 or more Defense has ued Reflect, or if a Pokemon with 512 or more Special has used Light Screen
 .specialAttackCritCheck
 	ld hl, wBattleMonSpecial
 	ld a, [wCriticalHitOrOHKO]
@@ -4277,7 +4277,7 @@
 	rr c
 	srl b
 	rr c
-; defensive stat can actually end up as 0, leading to a division by 0 freeze during damage calculation	
+; defensive stat can actually end up as 0, leading to a division by 0 freeze during damage calculation
 ; hl /= 4 (scale player's offensive stat)
 	srl h
 	rr l
@@ -4356,7 +4356,7 @@
 	sla c
 	rl b
 ; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if
-; a Pokemon with 512 or more Defense has ued Reflect, or if a Pokemon with 512 or more Special has used Light Screen 
+; a Pokemon with 512 or more Defense has ued Reflect, or if a Pokemon with 512 or more Special has used Light Screen
 .specialAttackCritCheck
 	ld hl, wEnemyMonSpecial
 	ld a, [wCriticalHitOrOHKO]
@@ -4389,7 +4389,7 @@
 	rr c
 	srl b
 	rr c
-; defensive stat can actually end up as 0, leading to a division by 0 freeze during damage calculation		
+; defensive stat can actually end up as 0, leading to a division by 0 freeze during damage calculation
 ; hl /= 4 (scale enemy's offensive stat)
 	srl h
 	rr l
@@ -4611,7 +4611,7 @@
 	ld [hld], a
 	jr nc, .done
 	inc [hl]
-	
+
 .done
 ; minimum damage is 1
 	ld a, 1
@@ -4713,9 +4713,9 @@
 
 ; function to determine if Counter hits and if so, how much damage it does
 HandleCounterMove: ; 3e093 (f:6093)
-; The variables checked by Counter are updated whenever the cursor points to a new move in the battle selection menu. 
-; This is irrelevant for the opponent's side outside of link battles, since the move selection is controlled by the AI. 
-; However, in the scenario where the player switches out and the opponent uses Counter, 
+; The variables checked by Counter are updated whenever the cursor points to a new move in the battle selection menu.
+; This is irrelevant for the opponent's side outside of link battles, since the move selection is controlled by the AI.
+; However, in the scenario where the player switches out and the opponent uses Counter,
 ; the outcome may be affected by the player's actions in the move selection menu prior to switching the Pokemon.
 ; This might also lead to desync glitches in link battles.
 
@@ -4756,7 +4756,7 @@
 	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]
@@ -4812,7 +4812,7 @@
 	ld a,[hl]
 	ld b,a ; Seismic Toss deals damage equal to the user's level
 	ld a,[W_PLAYERMOVENUM]
-	cp a,SEISMIC_TOSS 
+	cp a,SEISMIC_TOSS
 	jr z,.storeDamage
 	cp a,NIGHT_SHADE
 	jr z,.storeDamage
@@ -6747,11 +6747,11 @@
 HandleExplodingAnimation: ; 3eed3 (f:6ed3)
 	ld a, [H_WHOSETURN]
 	and a
-	ld hl, wEnemyMonType1 ; wcfea 
+	ld hl, wEnemyMonType1 ; wcfea
 	ld de, W_ENEMYBATTSTATUS1
 	ld a, [W_PLAYERMOVENUM]
 	jr z, .asm_3eeea
-	ld hl, wBattleMonType1 ; wd019 
+	ld hl, wBattleMonType1 ; wd019
 	ld de, W_ENEMYBATTSTATUS1
 	ld a, [W_ENEMYMOVENUM]
 .asm_3eeea
@@ -7206,7 +7206,7 @@
 .setSleepCounter
 ; set target's sleep counter to a random number between 1 and 7
 	call BattleRandom
-	and $7 
+	and $7
 	jr z, .setSleepCounter
 	ld [de], a
 	call Func_3fb89
@@ -7261,7 +7261,7 @@
 	jr nz, .didntAffect
 	jr .inflictPoison
 .sideEffectTest
-	call BattleRandom 
+	call BattleRandom
 	cp b ; was side effect successful?
 	ret nc
 .inflictPoison
@@ -7346,7 +7346,7 @@
 	ld [wcc5b], a
 	call CheckTargetSubstitute ; test bit 4 of d063/d068 flags [target has substitute flag]
 	ret nz ; return if they have a substitute, can't effect them
-	ld a, [$fff3]  
+	ld a, [$fff3]
 	and a
 	jp nz, opponentAttacker
 	ld a, [wEnemyMonStatus]
@@ -7367,10 +7367,10 @@
 	ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance
 	sub a, $1e ; subtract $1E to map to equivalent 10% chance effects
 .next1
-	push af     
+	push af
 	call BattleRandom ; get random 8bit value for probability test
 	cp b
-	pop bc     
+	pop bc
 	ret nc ; do nothing if random value is >= 1A or 4D [no status applied]
 	ld a, b ; what type of effect is this?
 	cp a, BURN_SIDE_EFFECT1
@@ -7377,12 +7377,12 @@
 	jr z, .burn
 	cp a, FREEZE_SIDE_EFFECT
 	jr z, .freeze
-; .paralyze	
+; .paralyze
 	ld a, 1 << PAR
 	ld [wEnemyMonStatus], a
 	call QuarterSpeedDueToParalysis ; quarter speed of affected mon
 	ld a, ANIM_A9
-	call PlayBattleAnimatiom 
+	call PlayBattleAnimation
 	jp PrintMayNotAttackText ; print paralysis text
 .burn
 	ld a, 1 << BRN
@@ -7389,7 +7389,7 @@
 	ld [wEnemyMonStatus], a
 	call HalveAttackDueToBurn ; halve attack of affected mon
 	ld a, ANIM_A9
-	call PlayBattleAnimatiom 
+	call PlayBattleAnimation
 	ld hl, BurnedText
 	jp PrintText
 .freeze
@@ -7397,7 +7397,7 @@
 	ld a, 1 << FRZ
 	ld [wEnemyMonStatus], a
 	ld a, ANIM_A9
-	call PlayBattleAnimatiom 
+	call PlayBattleAnimation
 	ld hl, FrozenText
 	jp PrintText
 opponentAttacker: ; 3f382 (f:7382)
@@ -7458,7 +7458,7 @@
 ; any fire-type move that has a chance inflict burn (all but Fire Spin) will defrost a frozen target
 	and a, 1 << FRZ	; are they frozen?
 	ret z ; return if so
-	ld a, [$fff3]	
+	ld a, [$fff3]
 	and a
 	jr nz, .opponent
 	;player [attacker]
@@ -7503,7 +7503,7 @@
 	ld de, W_ENEMYMOVEEFFECT
 .statModifierUpEffect
 	ld a, [de]
-	sub ATTACK_UP1_EFFECT 
+	sub ATTACK_UP1_EFFECT
 	cp $8
 	jr c, .incrementStatMod
 	sub ATTACK_UP2_EFFECT - ATTACK_UP1_EFFECT ; map +2 effects to equivalent +1 effect
@@ -7581,7 +7581,7 @@
 	ld b, $4
 	call Divide
 	pop hl
-; cap at 999	
+; cap at 999
 	ld a, [$ff98]
 	sub $e7
 	ld a, [$ff97]
@@ -7643,7 +7643,7 @@
 	ld hl, MonsStatsRoseText
 	call PrintText
 
-; these shouldn't be here	
+; these shouldn't be here
 	call QuarterSpeedDueToParalysis ; apply speed penalty to the player whose turn is not, if it's paralyzed
 	jp HalveAttackDueToBurn ; apply attack penalty to the player whose turn is not, if it's burned
 
@@ -7721,7 +7721,7 @@
 	bit 6, a ; fly/dig
 	jp nz, MoveMissed
 	ld a, [de]
-	sub ATTACK_DOWN1_EFFECT 
+	sub ATTACK_DOWN1_EFFECT
 	cp $8
 	jr c, .decrementStatMod
 	sub ATTACK_DOWN2_EFFECT - ATTACK_DOWN1_EFFECT ; map +2 effects to corresponding +1 effect
@@ -7741,9 +7741,9 @@
 	jr nz, .ok
 	inc b ; increment mod to 1 (-6) if it would become 0 (-7)
 .ok
-	ld [hl], b ; save modified mod 
+	ld [hl], b ; save modified mod
 	ld a, c
-	cp $4 
+	cp $4
 	jr nc, UpdateStat2Done ; jump for evasion/accuracy
 	push hl
 	push de
@@ -7832,10 +7832,10 @@
 								  ; even to those not affected by the stat-up move (will be boosted further)
 	ld hl, MonsStatsFellText
 	call PrintText
-	
-; These where probably added given that a stat-down move affecting speed or attack will override 
+
+; These where probably added given that a stat-down move affecting speed or attack will override
 ; the stat penalties from paralysis and burn respectively.
-; But they are always called regardless of the stat affected by the stat-down move.  	
+; But they are always called regardless of the stat affected by the stat-down move.
 	call QuarterSpeedDueToParalysis
 	jp HalveAttackDueToBurn
 
@@ -7960,7 +7960,7 @@
 .thrashPetalDanceEffect
 	set 1, [hl] ; mon is now using thrash/petal dance
 	call BattleRandom
-	and $1 
+	and $1
 	inc a
 	inc a
 	ld [de], a ; set thrash/petal dance counter to 2 or 3 at random
@@ -8057,7 +8057,7 @@
 	jp Func_3fb4e
 .asm_3f7e4
 	push af
-	call PlayBattleAnimatiom
+	call PlayBattleAnimation
 	ld c, $14
 	call DelayFrames
 	pop af
@@ -8109,14 +8109,14 @@
 	cp ATTACK_TWICE_EFFECT
 	ld a, $2 ; number of hits it's always 2 for ATTACK_TWICE_EFFECT
 	jr z, .saveNumberOfHits
-; for TWO_TO_FIVE_ATTACKS_EFFECT 3/8 chance for 2 and 3 hits, and 1/8 chance for 4 and 5 hits	
+; for TWO_TO_FIVE_ATTACKS_EFFECT 3/8 chance for 2 and 3 hits, and 1/8 chance for 4 and 5 hits
 	call BattleRandom
-	and $3 
-	cp $2 
-	jr c, .asm_3f851 
+	and $3
+	cp $2
+	jr c, .asm_3f851
 	call BattleRandom
 	and $3
-.asm_3f851 
+.asm_3f851
 	inc a
 	inc a
 .saveNumberOfHits
@@ -8185,7 +8185,7 @@
 	xor a
 	ld [wcc5b], a
 	ld a, b
-	call PlayBattleAnimatiom
+	call PlayBattleAnimation
 	ld a, [de]
 	ld [wWhichTrade], a
 	ld hl, ChargeMoveEffectText
@@ -8660,7 +8660,7 @@
 	and a
 	ret z
 
-PlayBattleAnimatiom: ; 3fbb9 (f:7bb9)
+PlayBattleAnimation: ; 3fbb9 (f:7bb9)
 	ld [W_ANIMATIONID], a
 
 Func_3fbbc: ; 3fbbc (f:7bbc)
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -53,7 +53,7 @@
 
 HiddenCoins: ; 76799 (1d:6799)
 	ld b, COIN_CASE
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	ld a, b
 	and a
 	ret z
--- a/home.asm
+++ b/home.asm
@@ -2712,7 +2712,7 @@
 ; set zero flag if item isn't in player's bag
 ; else reset zero flag
 ; related to Pokémon Tower and ghosts
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	ld a,b
 	and a
 	ret
--- a/scripts/celadonmartroof.asm
+++ b/scripts/celadonmartroof.asm
@@ -14,7 +14,7 @@
 	push de
 	ld [wd11e], a
 	ld b, a
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	pop de
 	pop hl
 	ld a, b
--- a/scripts/ceruleanhouse1.asm
+++ b/scripts/ceruleanhouse1.asm
@@ -13,5 +13,5 @@
 	db $08 ; asm
 	ld a, $6
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
--- a/scripts/ceruleanhousetrashed.asm
+++ b/scripts/ceruleanhousetrashed.asm
@@ -10,7 +10,7 @@
 CeruleanHouseTrashedText1: ; 1d68f (7:568f)
 	db $08 ; asm
 	ld b, $e4
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	and b
 	jr z, .asm_f8734 ; 0x1d698
 	ld hl, CeruleanHouseTrashedText_1d6b0
--- a/scripts/lab2.asm
+++ b/scripts/lab2.asm
@@ -21,5 +21,5 @@
 	ld a, $8
 	ld [wWhichTrade], a
 asm_78552: ; 75c3d (1d:5c3d)
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
--- a/scripts/lab4.asm
+++ b/scripts/lab4.asm
@@ -20,7 +20,7 @@
 	push de
 	ld [wd11e], a
 	ld b, a
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	pop de
 	pop hl
 	ld a, b
@@ -108,7 +108,7 @@
 	db $08 ; asm
 	ld a, $3
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
 
 LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8)
--- a/scripts/route11gateupstairs.asm
+++ b/scripts/route11gateupstairs.asm
@@ -11,7 +11,7 @@
 	db $08 ; asm
 	xor a
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 asm_49469: ; 49469 (12:5469)
 	jp TextScriptEnd
 
--- a/scripts/route18gateupstairs.asm
+++ b/scripts/route18gateupstairs.asm
@@ -10,7 +10,7 @@
 	db $08 ; asm
 	ld a, $5
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
 
 Route18GateUpstairsText2: ; 4998c (12:598c)
--- a/scripts/route2house.asm
+++ b/scripts/route2house.asm
@@ -13,5 +13,5 @@
 	db $08 ; asm
 	ld a, $1
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
--- a/scripts/undergroundpathentranceroute5.asm
+++ b/scripts/undergroundpathentranceroute5.asm
@@ -13,6 +13,6 @@
 	db $08 ; asm
 	ld a, $9
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	ld hl, UndergroundPathEntranceRoute5_5d6af
 	ret
--- a/scripts/vermilioncity.asm
+++ b/scripts/vermilioncity.asm
@@ -55,7 +55,7 @@
 	bit 2, a
 	jr nz, .asm_19810 ; 0x19804 $a
 	ld b, $3f
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	ld a, b
 	and a
 	ret nz
@@ -175,7 +175,7 @@
 	ld hl, SSAnneWelcomeText9
 	call PrintText
 	ld b, S_S__TICKET
-	predef IsItemInBag_ 
+	predef IsItemInBag_
 	ld a, b
 	and a
 	jr nz, .asm_0419b ; 0x198df
--- a/scripts/vermilionhouse3.asm
+++ b/scripts/vermilionhouse3.asm
@@ -8,5 +8,5 @@
 	db $08 ; asm
 	ld a, $4
 	ld [wWhichTrade], a
-	predef Predef54 
+	predef Predef54
 	jp TextScriptEnd
--- a/wram.asm
+++ b/wram.asm
@@ -393,7 +393,7 @@
 wcd05:: ds 1
 wcd06:: ds 9
 
-wPlayerMonUnmodifiedLevel:: ; cd0f 
+wPlayerMonUnmodifiedLevel:: ; cd0f
 	ds 0
 wcd0f:: ; overload, used in in-game trade code
 	ds 1