# Conflicts:
#	audio/engine.asm
#	constants/gfx_constants.asm
#	constants/map_data_constants.asm
#	constants/pokemon_data_constants.asm
#	constants/sprite_constants.asm
#	constants/wram_constants.asm
#	data/maps/data.asm
#	engine/battle/ai/scoring.asm
#	engine/battle/core.asm
#	engine/battle/effect_commands.asm
#	engine/battle/misc.asm
#	engine/battle_anims/getpokeballwobble.asm
#	engine/breeding.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/events/battle_tower/battle_tower.asm
#	engine/events/battle_tower/rules.asm
#	engine/events/buena.asm
#	engine/events/bug_contest/contest_2.asm
#	engine/events/daycare.asm
#	engine/events/dratini.asm
#	engine/events/halloffame.asm
#	engine/events/happiness_egg.asm
#	engine/events/kurt.asm
#	engine/events/lucky_number.asm
#	engine/events/magnet_train.asm
#	engine/events/overworld.asm
#	engine/events/pokerus/pokerus.asm
#	engine/events/print_unown.asm
#	engine/events/print_unown_2.asm
#	engine/events/unown_walls.asm
#	engine/item_effects.asm
#	engine/link.asm
#	engine/mon_menu.asm
#	engine/player_object.asm
#	engine/routines/playslowcry.asm
#	engine/scripting.asm
#	engine/search.asm
#	engine/search2.asm
#	engine/specials.asm
#	engine/start_menu.asm
#	engine/timeset.asm
#	home/battle_vars.asm
#	home/map.asm
#	maps/GoldenrodUndergroundSwitchRoomEntrances.asm
#	maps/IlexForest.asm
#	maps/KrissHouse2F.asm
#	maps/Route39Barn.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_5f.asm
#	wram.asm
This commit is contained in:
Rangi
2018-02-03 18:21:53 -05:00
367 changed files with 8920 additions and 8922 deletions

View File

@@ -2,19 +2,19 @@ DoPlayerMovement:: ; 80000
call .GetDPad
ld a, movement_step_sleep
ld [MovementAnimation], a
ld [wMovementAnimation], a
xor a
ld [wd041], a
call .TranslateIntoMovement
ld c, a
ld a, [MovementAnimation]
ld a, [wMovementAnimation]
ld [wPlayerNextMovement], a
ret
.GetDPad:
ld a, [hJoyDown]
ld [CurInput], a
ld [wCurInput], a
; Standing downhill instead moves down.
@@ -28,12 +28,12 @@ DoPlayerMovement:: ; 80000
ld a, c
or D_DOWN
ld [CurInput], a
ld [wCurInput], a
ret
; 8002d
.TranslateIntoMovement:
ld a, [PlayerState]
ld a, [wPlayerState]
cp PLAYER_NORMAL
jr z, .Normal
cp PLAYER_SURF
@@ -84,7 +84,7 @@ DoPlayerMovement:: ; 80000
ret c
call .CheckWarp
ret c
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
cp STANDING
jr z, .HitWall
call .BumpSound
@@ -94,12 +94,12 @@ DoPlayerMovement:: ; 80000
ret
.NotMoving:
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
cp STANDING
jr z, .Standing
; Walking into an edge warp won't bump.
ld a, [EngineBuffer4]
ld a, [wEngineBuffer4]
and a
jr nz, .CantMove
call .BumpSound
@@ -118,7 +118,7 @@ DoPlayerMovement:: ; 80000
; Tiles such as waterfalls and warps move the player
; in a given direction, overriding input.
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
ld c, a
call CheckWhirlpoolTile
jr c, .not_whirlpool
@@ -146,7 +146,7 @@ DoPlayerMovement:: ; 80000
ld hl, .water_table
add hl, bc
ld a, [hl]
ld [WalkingDirection], a
ld [wWalkingDirection], a
jr .continue_walk
.water_table
@@ -165,7 +165,7 @@ DoPlayerMovement:: ; 80000
ld a, [hl]
cp STANDING
jr z, .no_walk
ld [WalkingDirection], a
ld [wWalkingDirection], a
jr .continue_walk
.land1_table
@@ -188,7 +188,7 @@ DoPlayerMovement:: ; 80000
ld a, [hl]
cp STANDING
jr z, .no_walk
ld [WalkingDirection], a
ld [wWalkingDirection], a
jr .continue_walk
.land2_table
@@ -214,7 +214,7 @@ DoPlayerMovement:: ; 80000
.down
ld a, DOWN
ld [WalkingDirection], a
ld [wWalkingDirection], a
jr .continue_walk
.no_walk
@@ -236,12 +236,12 @@ DoPlayerMovement:: ; 80000
ld a, [wPlayerTurningDirection]
cp 0
jr nz, .not_turning
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
cp STANDING
jr z, .not_turning
ld e, a
ld a, [PlayerDirection]
ld a, [wPlayerDirection]
rrca
rrca
maskbits NUM_DIRECTIONS
@@ -262,7 +262,7 @@ DoPlayerMovement:: ; 80000
.TryStep: ; 8016b
; Surfing actually calls .TrySurf directly instead of passing through here.
ld a, [PlayerState]
ld a, [wPlayerState]
cp PLAYER_SURF
jr z, .TrySurf
cp PLAYER_SURF_PIKA
@@ -277,7 +277,7 @@ DoPlayerMovement:: ; 80000
cp 2
jr z, .bump
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
call CheckIceTile
jr nc, .ice
@@ -289,7 +289,7 @@ DoPlayerMovement:: ; 80000
bit BIKEFLAGS_DOWNHILL_F, [hl]
jr z, .fast
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
cp DOWN
jr z, .fast
@@ -362,7 +362,7 @@ DoPlayerMovement:: ; 80000
; 801f3
.TryJump: ; 801f3
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
ld e, a
and $f0
cp HI_NYBBLE_LEDGES
@@ -374,7 +374,7 @@ DoPlayerMovement:: ; 80000
ld d, 0
ld hl, .data_8021e
add hl, de
ld a, [FacingDirection]
ld a, [wFacingDirection]
and [hl]
jr z, .DontJump
@@ -408,26 +408,26 @@ DoPlayerMovement:: ; 80000
; This causes wd041 to be nonzero when standing on tile $3e,
; making bumps silent.
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
; cp STANDING
; jr z, .not_warp
ld e, a
ld d, 0
ld hl, .EdgeWarps
add hl, de
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
cp [hl]
jr nz, .not_warp
ld a, 1
ld [wd041], a
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
; This is in the wrong place.
cp STANDING
jr z, .not_warp
ld e, a
ld a, [PlayerDirection]
ld a, [wPlayerDirection]
rrca
rrca
maskbits NUM_DIRECTIONS
@@ -462,14 +462,14 @@ DoPlayerMovement:: ; 80000
ld h, [hl]
ld l, a
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
ld e, a
cp STANDING
jp z, .StandInPlace
add hl, de
ld a, [hl]
ld [MovementAnimation], a
ld [wMovementAnimation], a
ld hl, .FinishFacing
add hl, de
@@ -535,7 +535,7 @@ DoPlayerMovement:: ; 80000
ld a, 0
ld [wPlayerTurningDirection], a
ld a, movement_step_sleep
ld [MovementAnimation], a
ld [wMovementAnimation], a
xor a
ret
; 802bf
@@ -544,7 +544,7 @@ DoPlayerMovement:: ; 80000
ld a, 0
ld [wPlayerTurningDirection], a
ld a, movement_step_bump
ld [MovementAnimation], a
ld [wMovementAnimation], a
xor a
ret
; 802cb
@@ -564,10 +564,10 @@ DoPlayerMovement:: ; 80000
ld d, 0
ld hl, .forced_dpad
add hl, de
ld a, [CurInput]
ld a, [wCurInput]
and BUTTONS
or [hl]
ld [CurInput], a
ld [wCurInput], a
ret
.forced_dpad
@@ -579,7 +579,7 @@ DoPlayerMovement:: ; 80000
ld hl, .table
ld de, .table2 - .table1
ld a, [CurInput]
ld a, [wCurInput]
bit D_DOWN_F, a
jr nz, .d_down
bit D_UP_F, a
@@ -598,18 +598,18 @@ DoPlayerMovement:: ; 80000
.update
ld a, [hli]
ld [WalkingDirection], a
ld [wWalkingDirection], a
ld a, [hli]
ld [FacingDirection], a
ld [wFacingDirection], a
ld a, [hli]
ld [WalkingX], a
ld [wWalkingX], a
ld a, [hli]
ld [WalkingY], a
ld [wWalkingY], a
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [hl]
ld [WalkingTile], a
ld [wWalkingTile], a
ret
.table
@@ -621,16 +621,16 @@ DoPlayerMovement:: ; 80000
; tile collision pointer
.table1
db STANDING, FACE_CURRENT, 0, 0
dw PlayerStandingTile
dw wPlayerStandingTile
.table2
db RIGHT, FACE_RIGHT, 1, 0
dw TileRight
dw wTileRight
db LEFT, FACE_LEFT, -1, 0
dw TileLeft
dw wTileLeft
db UP, FACE_UP, 0, -1
dw TileUp
dw wTileUp
db DOWN, FACE_DOWN, 0, 1
dw TileDown
dw wTileDown
; 80341
.CheckNPC: ; 80341
@@ -640,19 +640,19 @@ DoPlayerMovement:: ; 80000
ld a, 0
ld [hMapObjectIndexBuffer], a
; Load the next X coordinate into d
ld a, [PlayerStandingMapX]
ld a, [wPlayerStandingMapX]
ld d, a
ld a, [WalkingX]
ld a, [wWalkingX]
add d
ld d, a
; Load the next Y coordinate into e
ld a, [PlayerStandingMapY]
ld a, [wPlayerStandingMapY]
ld e, a
ld a, [WalkingY]
ld a, [wWalkingY]
add e
ld e, a
; Find an object struct with coordinates equal to d,e
ld bc, ObjectStructs ; redundant
ld bc, wObjectStructs ; redundant
farcall IsNPCAtCoord
jr nc, .is_npc
call .CheckStrengthBoulder
@@ -691,7 +691,7 @@ DoPlayerMovement:: ; 80000
add hl, bc
set 2, [hl]
ld a, [WalkingDirection]
ld a, [wWalkingDirection]
ld d, a
ld hl, OBJECT_RANGE
add hl, bc
@@ -712,13 +712,13 @@ DoPlayerMovement:: ; 80000
; Return 0 if walking onto land and tile permissions allow it.
; Otherwise, return carry.
ld a, [TilePermissions]
ld a, [wTilePermissions]
ld d, a
ld a, [FacingDirection]
ld a, [wFacingDirection]
and d
jr nz, .NotWalkable
ld a, [WalkingTile]
ld a, [wWalkingTile]
call .CheckWalkable
jr c, .NotWalkable
@@ -734,13 +734,13 @@ DoPlayerMovement:: ; 80000
; Return 0 if moving in water, or 1 if moving onto land.
; Otherwise, return carry.
ld a, [TilePermissions]
ld a, [wTilePermissions]
ld d, a
ld a, [FacingDirection]
ld a, [wFacingDirection]
and d
jr nz, .NotSurfable
ld a, [WalkingTile]
ld a, [wWalkingTile]
call .CheckSurfable
jr c, .NotSurfable
@@ -753,7 +753,7 @@ DoPlayerMovement:: ; 80000
; 803ca
.BikeCheck: ; 803ca
ld a, [PlayerState]
ld a, [wPlayerState]
cp PLAYER_BIKE
ret z
cp PLAYER_SKATE
@@ -810,7 +810,7 @@ DoPlayerMovement:: ; 80000
.GetOutOfWater: ; 803f9
push bc
ld a, PLAYER_NORMAL
ld [PlayerState], a
ld [wPlayerState], a
call ReplaceKrisSprite ; UpdateSprites
pop bc
ret
@@ -822,10 +822,10 @@ CheckStandingOnIce:: ; 80404
jr z, .not_ice
cp $f0
jr z, .not_ice
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
call CheckIceTile
jr nc, .yep
ld a, [PlayerState]
ld a, [wPlayerState]
cp PLAYER_SKATE
jr nz, .not_ice