Merge remote-tracking branch 'YamaArashi/master'

Conflicts:
	constants/misc_constants.asm
	engine/battle/core.asm
	engine/menu/pokedex.asm
	engine/town_map.asm
	home.asm
	hram.asm
This commit is contained in:
yenatch 2014-09-20 00:57:27 -04:00
commit dff0cdeb5a
224 changed files with 15213 additions and 4665 deletions

View file

@ -237,7 +237,7 @@ ItemUseBall: ; d687 (3:5687)
ld [H_QUOTIENT + 3],a
.next9 ;$5776
pop bc
ld a,[wd007] ;enemy: Catch Rate
ld a,[wEnemyMonCatchRate] ;enemy: Catch Rate
cp b
jr c,.next10
ld a,[H_QUOTIENT + 2]
@ -256,7 +256,7 @@ ItemUseBall: ; d687 (3:5687)
xor a
ld [H_MULTIPLICAND],a
ld [H_MULTIPLICAND + 1],a
ld a,[wd007] ;enemy: Catch Rate
ld a,[wEnemyMonCatchRate] ;enemy: Catch Rate
ld [H_MULTIPLICAND + 2],a
ld a,100
ld [H_MULTIPLIER],a
@ -376,7 +376,7 @@ ItemUseBall: ; d687 (3:5687)
ld [wcf91],a
ld a,[wEnemyMonLevel]
ld [W_CURENEMYLVL],a
callab Func_3eb01
callab LoadEnemyMonData
pop af
ld [wcf91],a
pop hl
@ -507,8 +507,8 @@ ItemUseBicycle: ; d977 (3:5977)
ld a,[W_ISINBATTLE]
and a
jp nz,ItemUseNotTime
ld a,[wd700]
ld [wd11a],a
ld a,[wWalkBikeSurfState]
ld [wWalkBikeSurfStateCopy],a
cp a,2 ; is the player surfing?
jp z,ItemUseNotTime
dec a ; is player already bicycling?
@ -516,8 +516,8 @@ ItemUseBicycle: ; d977 (3:5977)
.getOffBike
call ItemUseReloadOverworldData
xor a
ld [wd700],a ; change player state to walking
call Func_2307 ; play walking music
ld [wWalkBikeSurfState],a ; change player state to walking
call PlayDefaultMusic ; play walking music
ld hl,GotOffBicycleText
jr .printText
.tryToGetOnBike
@ -527,16 +527,16 @@ ItemUseBicycle: ; d977 (3:5977)
xor a ; no keys pressed
ld [hJoyHeld],a ; current joypad state
inc a
ld [wd700],a ; change player state to bicycling
ld [wWalkBikeSurfState],a ; change player state to bicycling
ld hl,GotOnBicycleText
call Func_2307 ; play bike riding music
call PlayDefaultMusic ; play bike riding music
.printText
jp PrintText
; used for Surf out-of-battle effect
ItemUseSurfboard: ; d9b4 (3:59b4)
ld a,[wd700]
ld [wd11a],a
ld a,[wWalkBikeSurfState]
ld [wWalkBikeSurfStateCopy],a
cp a,2 ; is the player already surfing?
jr z,.tryToStopSurfing
.tryToSurf
@ -550,8 +550,8 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld hl,wd730
set 7,[hl]
ld a,2
ld [wd700],a ; change player state to surfing
call Func_2307 ; play surfing music
ld [wWalkBikeSurfState],a ; change player state to surfing
call PlayDefaultMusic ; play surfing music
ld hl,SurfingGotOnText
jp PrintText
.tryToStopSurfing
@ -570,7 +570,7 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld a,[hli]
ld h,[hl]
ld l,a ; hl now points to passable tiles
ld a,[wcfc6] ; tile in front of the player
ld a,[wTileInFrontOfPlayer] ; tile in front of the player
ld b,a
.passableTileLoop
ld a,[hli]
@ -586,31 +586,31 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
ld hl,wd730
set 7,[hl]
xor a
ld [wd700],a ; change player state to walking
ld [wWalkBikeSurfState],a ; change player state to walking
dec a
ld [wJoyIgnore],a
call Func_2307 ; play walking music
call PlayDefaultMusic ; play walking music
jp LoadWalkingPlayerSpriteGraphics
; uses a simulated button press to make the player move forward
.makePlayerMoveForward
ld a,[wd52a] ; direction the player is going
bit 3,a
ld b,%01000000 ; Up key
ld b,D_UP
jr nz,.storeSimulatedButtonPress
bit 2,a
ld b,%10000000 ; Down key
ld b,D_DOWN
jr nz,.storeSimulatedButtonPress
bit 1,a
ld b,%00100000 ; Left key
ld b,D_LEFT
jr nz,.storeSimulatedButtonPress
ld b,%00010000 ; Right key
ld b,D_RIGHT
.storeSimulatedButtonPress
ld a,b
ld [wccd3],a ; base address of simulated button presses
ld [wSimulatedJoypadStatesEnd],a
xor a
ld [wcd39],a
ld [wWastedByteCD39],a
inc a
ld [wcd38],a ; index of current simulated button press
ld [wSimulatedJoypadStatesIndex],a
ret
SurfingGotOnText: ; da4c (3:5a4c)
@ -636,7 +636,7 @@ ItemUseEvoStone: ; da5b (3:5a5b)
ld a,$05 ; evolution stone party menu
ld [wd07d],a
ld a,$ff
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
call DisplayPartyMenu
pop bc
jr c,.canceledItemUse
@ -647,7 +647,7 @@ ItemUseEvoStone: ; da5b (3:5a5b)
ld a,(SFX_02_3e - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent ; play sound
call WaitForSoundToFinish ; wait for sound to end
callab Func_3ad0e ; try to evolve pokemon
callab TryEvolvingMon ; try to evolve pokemon
ld a,[wd121]
and a
jr z,.noEffect
@ -681,7 +681,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,$01
ld [wd07d],a ; item use party menu
ld a,$ff
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
ld a,[wd152]
and a ; using Softboiled?
jr z,.notUsingSoftboiled
@ -805,7 +805,7 @@ ItemUseMedicine: ; dabb (3:5abb)
push bc
ld a,[wcf06]
ld c,a
ld hl,wccf5
ld hl,wPartyFoughtCurrentEnemyFlags
ld b,$02
predef FlagActionPredef
ld a,c
@ -813,7 +813,7 @@ ItemUseMedicine: ; dabb (3:5abb)
jr z,.next
ld a,[wcf06]
ld c,a
ld hl,wPartyAliveFlags
ld hl,wPartyGainExpFlags
ld b,$01
predef FlagActionPredef
.next
@ -1096,7 +1096,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [H_AUTOBGTRANSFERENABLED],a
call ClearScreen
dec a
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
call RedrawPartyMenu ; redraws the party menu and displays the message
ld a,1
ld [H_AUTOBGTRANSFERENABLED],a
@ -1273,12 +1273,12 @@ ItemUseMedicine: ; dabb (3:5abb)
call WaitForTextScrollButtonPress ; wait for button press
xor a
ld [wcc49],a
predef Func_3af5b ; learn level up move, if any
predef LearnMoveFromLevelUp ; learn level up move, if any
xor a
ld [wccd4],a
callab Func_3ad0e ; evolve pokemon, if appropriate
callab TryEvolvingMon ; evolve pokemon, if appropriate
ld a,$01
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
pop af
ld [wcf91],a
pop af
@ -1303,17 +1303,17 @@ VitaminText: ; df2e (3:5f2e)
ItemUseBait: ; df52 (3:5f52)
ld hl,ThrewBaitText
call PrintText
ld hl,wd007 ; catch rate
ld hl,wEnemyMonCatchRate ; catch rate
srl [hl] ; halve catch rate
ld a,BAIT_ANIM
ld hl,wcce9 ; bait factor
ld de,wcce8 ; escape factor
ld hl,wSafariBaitFactor ; bait factor
ld de,wSafariEscapeFactor ; escape factor
jr BaitRockCommon
ItemUseRock: ; df67 (3:5f67)
ld hl,ThrewRockText
call PrintText
ld hl,wd007 ; catch rate
ld hl,wEnemyMonCatchRate ; catch rate
ld a,[hl]
add a ; double catch rate
jr nc,.noCarry
@ -1321,8 +1321,8 @@ ItemUseRock: ; df67 (3:5f67)
.noCarry
ld [hl],a
ld a,ROCK_ANIM
ld hl,wcce8 ; escape factor
ld de,wcce9 ; bait factor
ld hl,wSafariEscapeFactor ; escape factor
ld de,wSafariBaitFactor ; bait factor
BaitRockCommon: ; df7f (3:5f7f)
ld [W_ANIMATIONID],a
@ -1383,7 +1383,7 @@ ItemUseEscapeRope: ; dfaf (3:5faf)
ld [W_NUMSAFARIBALLS],a
ld [W_SAFARIZONEENTRANCECURSCRIPT],a
inc a
ld [wd078],a
ld [wEscapedFromBattle],a
ld [wcd6a],a ; item used
ld a,[wd152]
and a ; using Dig?
@ -1424,8 +1424,8 @@ ItemUseXAccuracy: ; e013 (3:6013)
ItemUseCardKey: ; e022 (3:6022)
xor a
ld [wd71f],a
call Func_c586
ld a,[Func_c586] ; $4586
call GetTileAndCoordsInFrontOfPlayer
ld a,[GetTileAndCoordsInFrontOfPlayer] ; $4586
cp a,$18
jr nz,.next0
ld hl,CardKeyTable1
@ -1517,7 +1517,7 @@ ItemUsePokedoll: ; e0cd (3:60cd)
dec a
jp nz,ItemUseNotTime
ld a,$01
ld [wd078],a
ld [wEscapedFromBattle],a
jp PrintItemUseTextAndRemoveItem
ItemUseGuardSpec: ; e0dc (3:60dc)
@ -1727,7 +1727,7 @@ PlayedFluteHadEffectText: ; e215 (3:6215)
ld a,[wc028]
cp a,$b8
jr z,.musicWaitLoop
call Func_2307 ; start playing normal music again
call PlayDefaultMusic ; start playing normal music again
.done
jp TextScriptEnd ; end text
@ -1796,7 +1796,7 @@ RodResponse: ; e28d (3:628d)
ld [W_CUROPPONENT], a
.next
ld hl, wd700
ld hl, wWalkBikeSurfState
ld a, [hl] ; store the value in a
push af
push hl
@ -1818,7 +1818,7 @@ FishingInit: ; e2b4 (3:62b4)
.notInBattle
call IsNextTileShoreOrWater
ret c
ld a,[wd700]
ld a,[wWalkBikeSurfState]
cp a,2 ; Surfing?
jr z,.surfing
call ItemUseReloadOverworldData
@ -1877,7 +1877,7 @@ ItemUsePPRestore: ; e31e (3:631e)
ld [wWhichTrade],a
.chooseMon
xor a
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
ld a,$01 ; item use party menu
ld [wd07d],a
call DisplayPartyMenu
@ -2117,7 +2117,7 @@ ItemUseTMHM: ; e479 (3:6479)
ld bc,14
call CopyData
ld a,$ff
ld [wcfcb],a
ld [wUpdateSpritesEnabled],a
ld a,$03 ; teach TM/HM party menu
ld [wd07d],a
call DisplayPartyMenu
@ -2744,7 +2744,7 @@ IsNextTileShoreOrWater: ; e8b8 (3:68b8)
jr nc, .notShoreOrWater
ld a, [W_CURMAPTILESET]
cp SHIP_PORT ; Vermilion Dock tileset
ld a, [wcfc6] ; tile in front of player
ld a, [wTileInFrontOfPlayer] ; tile in front of player
jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset
cp $48 ; eastern shore tile in Safari Zone
jr z, .shoreOrWater