Strong Arm, Water Sport, and more HMs.

This adds Rock Climb functionality to Strong Arm and Dive functionality to Water Sport, as discussed in the server. HMs have been added, but we need 16bit Items to add Wind Ride, and I haven't finished their functionality.

The Rock Climb tile is a bit terrible, it's not easy to notice. Maybe change so that it works well with yellow or another colour?

This does not build due to issues with effect_commands.asm, but since Zeta is meant to be working on the mapping and Water Sport anyway, it seems to be up his alley.

I ported over much of the underwater assets Rangi was using as they looked very pretty. I imagine it'll be fun to utilise going forward. May as well, right?

I shall now lay down in a dark room.

Review: c21561ea71 (diff-5508f3b794fc68821ba35e94b6a293b2aaaa16c02a1b34fac70d03fd2f74c4b2R113)
This commit is contained in:
Llinos Evans 2024-12-28 06:26:01 +00:00
parent 4b11121836
commit 093bda0253
77 changed files with 993 additions and 97 deletions

View file

@ -387,6 +387,8 @@ AI_Smart_EffectHandlers:
dbw EFFECT_SOLARBEAM, AI_Smart_Solarbeam
dbw EFFECT_THUNDER, AI_Smart_Thunder
dbw EFFECT_FLY, AI_Smart_Fly
dbw EFFECT_SURF, AI_Smart_Surf
dbw EFFECT_WHIRLPOOL, AI_Smart_Whirlpool
db -1 ; end
AI_Smart_Sleep:
@ -1137,15 +1139,19 @@ AI_Smart_SpDefenseUp2:
ret
AI_Smart_Fly:
; Fly, Dig
; Fly, Dig, Dive, Bounce
; Greatly encourage this move if the player is
; flying or underground, and slower than the enemy.
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .player_hidden
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret z
.player_hidden
call AICompareSpeed
ret nc
@ -1637,10 +1643,13 @@ AI_Smart_PriorityHit:
call AICompareSpeed
ret c
; Dismiss this move if the player is flying or underground.
; Dismiss this move if the player is flying, underwater, or underground.
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jp nz, AIDiscourageMove
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
jp nz, AIDiscourageMove
; Greatly encourage this move if it will KO the player.
ld a, 1
@ -1663,6 +1672,30 @@ AI_Smart_PriorityHit:
dec [hl]
dec [hl]
ret
AI_Smart_Surf:
AI_Smart_Whirlpool:
; Greatly encourage this move if the player is underwater and the enemy is faster.
ld a, [wLastPlayerCounterMove]
cp DIVE
ret nz
ld a, [wPlayerSubStatus4]
bit SUBSTATUS_UNDERWATER, a
jr z, .could_dive
call AICompareSpeed
ret nc
dec [hl]
dec [hl]
ret
.could_dive
; Try to predict if the player will use Dive this turn.
; 50% chance to encourage this move if the enemy is slower than the player.
call AICompareSpeed
ret c
call AI_50_50
ret c
dec [hl]
ret
AI_Smart_Thief:
; Don't use Thief unless it's the only move available.
@ -2633,15 +2666,19 @@ AI_Smart_Gust:
AI_Smart_FutureSight:
; Greatly encourage this move if the player is
; flying or underground, and slower than the enemy.
; flying, underwater, or underground, and slower than the enemy.
call AICompareSpeed
ret nc
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .player_hidden
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret z
.player_hidden
dec [hl]
dec [hl]
ret

View file

@ -1119,7 +1119,15 @@ ResidualDamage:
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .not_flying_or_underground
call Call_PlayBattleAnim_OnlyIfVisible
jr .called
.not_flying_or_underground
ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
call z, Call_PlayBattleAnim_OnlyIfVisible
.called
call SwitchTurnCore
call GetEighthMaxHP
@ -1302,6 +1310,11 @@ HandleWrap:
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .skip_anim
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
jr nz, .skip_anim
call SwitchTurnCore
xor a
@ -7094,6 +7107,11 @@ Call_PlayBattleAnim_OnlyIfVisible:
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret nz
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
ret nz
Call_PlayBattleAnim:
ld a, e

View file

@ -1,3 +1,9 @@
; Heavily edited when adding Water Sport's effect.
; If errors occur (especially involving Substitute), check https://github.com/Rangi42/pokecrystal/commit/c21561ea717feef9b2eb3785c2ea112cd0d19ba0#diff-88dbff1eb3920f69b17a3d5f613643e1a41096514706bc09f449e4aa637f20e4R5647
; There is a high chance you will run out of memory and I am not sure how this is resolved.
; I imagine bankswitches will be necessary.
DoPlayerTurn:
call SetPlayerTurn
@ -360,11 +366,16 @@ CantMove:
res SUBSTATUS_UNDERGROUND, [hl]
res SUBSTATUS_FLYING, [hl]
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVarAddr
res SUBSTATUS_UNDERWATER, [hl]
jp AppearUserRaiseSub
.fly_dig_moves
dw FLY
dw DIG
dw BOUNCE
dw WATER_SPORT
dw -1
OpponentCantMove:
@ -529,12 +540,17 @@ CheckEnemyTurn:
xor a
ld [wNumHits], a
; Flicker the monster pic unless flying or underground.
; Flicker the monster pic unless flying, underwater, or underground.
ld de, ANIM_HIT_CONFUSION
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .no_flicker
ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
call z, PlayFXAnimID
.no_flicker
ld c, TRUE
call DoEnemyDamage
@ -632,12 +648,17 @@ HitConfusion:
xor a
ld [wNumHits], a
; Flicker the monster pic unless flying or underground.
; Flicker the monster pic unless flying, underwater, or underground.
ld de, ANIM_HIT_CONFUSION
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .no_flicker
ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
call z, PlayFXAnimID
.no_flicker
ld hl, UpdatePlayerHUD
call CallBattleCore
@ -1746,13 +1767,25 @@ BattleCommand_CheckHit:
ret
.FlyDigMoves:
; Check for moves that can hit underground/flying opponents.
; Check for moves that can hit underground/flying opponents. And divers.
; Return z if the current move can hit the opponent.
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .flying_or_underground
ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
ret z
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
cp SURF
ret z
cp WHIRLPOOL
ret
.flying_or_underground
bit SUBSTATUS_FLYING, a
ld hl, .FlyMoves
@ -2032,6 +2065,8 @@ BattleCommand_MoveAnimNoSub:
.fly_dig_moves
dw FLY
dw DIG
dw BOUNCE
dw WATER_SPORT
dw -1
.alternate_anim
@ -2145,12 +2180,17 @@ BattleCommand_FailureText:
call GetBattleVarAddr
res SUBSTATUS_UNDERGROUND, [hl]
res SUBSTATUS_FLYING, [hl]
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVarAddr
res SUBSTATUS_UNDERWATER, [hl]
call AppearUserRaiseSub
jp EndMoveEffect
.fly_dig_moves
dw FLY
dw DIG
dw WATER_SPORT
dw BOUNCE
dw -1
BattleCommand_ApplyDamage:
@ -3420,6 +3460,11 @@ FarPlayBattleAnimation:
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret nz
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
ret nz
; fallthrough
@ -3606,7 +3651,12 @@ DoSubstituteDamage:
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .dont_lower_sub
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar
and 1 << SUBSTATUS_UNDERWATER
call z, AppearUserLowerSub
.dont_lower_sub
call BattleCommand_SwitchTurn
ld a, BATTLE_VARS_MOVE_EFFECT
@ -5545,6 +5595,9 @@ BattleCommand_CheckCharge:
res SUBSTATUS_CHARGED, [hl]
res SUBSTATUS_UNDERGROUND, [hl]
res SUBSTATUS_FLYING, [hl]
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVarAddr
res SUBSTATUS_UNDERWATER, [hl]
ld b, charge_command
jp SkipToBattleCommand
@ -5578,19 +5631,13 @@ BattleCommand_Charge:
call LoadMoveAnim
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld h, a
ld bc, FLY
call CompareMove
ld a, 1 << SUBSTATUS_FLYING
cp FLY
jr z, .got_move_type
if HIGH(FLY) != HIGH(DIG)
ld bc, DIG
else
ld c, LOW(DIG)
endc
ld a, h
call CompareMove
ld a, 1 << SUBSTATUS_UNDERGROUND
cp DIG
jr z, .got_move_type
cp BOUNCE
jr z, .got_move_type
cp WATER_SPORT
jr z, .got_move_type
call BattleCommand_RaiseSub
xor a
@ -5659,6 +5706,8 @@ BattleCommand_Charge:
dw SKY_ATTACK, .BattleGlowingText
dw FLY, .BattleFlewText
dw DIG, .BattleDugText
dw BOUNCE, .BattleFlewText
dw WATER_SPORT, .BattleWaterSportText
dw -1
.BattleMadeWhirlwindText:
@ -5685,9 +5734,10 @@ BattleCommand_Charge:
text_far _BattleDugText
text_end
BattleCommand_Unused3C:
; effect0x3c
ret
.BattleWaterSportText:
; 'hid underwater!'
text_jump HidUnderwaterText
db "@"
BattleCommand_TrapTarget:
ld a, [wAttackMissed]
@ -6440,10 +6490,6 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm"
INCLUDE "engine/battle/move_effects/rollout.asm"
BattleCommand_Unused5D:
; effect0x5d
ret
INCLUDE "engine/battle/move_effects/fury_cutter.asm"
INCLUDE "engine/battle/move_effects/attract.asm"

View file

@ -2916,11 +2916,17 @@ BGEffect_CheckFlyDigStatus:
jr nz, .player
ld a, [wEnemySubStatus3] ; EnemySubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret nz
ld a, [wEnemySubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret
.player
ld a, [wPlayerSubStatus3] ; PlayerSubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret nz
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret
BattleBGEffects_CheckSGB:

View file

@ -564,6 +564,9 @@ FlyFunction:
ld de, ENGINE_STORMBADGE
call CheckBadge
jr c, .nostormbadge
ld a, [wMapTileset]
cp TILESET_UNDERWATER
jr z, .indoors
call GetMapEnvironment
call CheckOutdoorMap
jr z, .outdoors
@ -972,12 +975,6 @@ StrengthFunction:
jr c, .Failed
jr .UseStrength
.AlreadyUsingStrength: ; unreferenced
ld hl, .AlreadyUsingStrengthText
call MenuTextboxBackup
ld a, $80
ret
.AlreadyUsingStrengthText:
text_far _AlreadyUsingStrengthText
text_end
@ -1542,6 +1539,8 @@ FishFunction:
jr z, .fail
cp PLAYER_SURF_PIKA
jr z, .fail
cp PLAYER_WATER_SPORT
jr z, .fail
call GetFacingTileCoord
call GetTileCollision
cp WATER_TILE
@ -1906,3 +1905,309 @@ CantCutScript:
CanCutText:
text_far _CanCutText
text_end
; Strong Arm is currently just Rock Climb. It's progressgated to after the Earth Badge, just as Rock Climb was in HGSS.
; This is a fine reward for beating Kanto, so I think it's ok to be here.
; It implies Rock Climb will be given in Oak's Lab.
; Eventually, this will also contain checks that jump to Strength and Rock Smash.
StrongArmFunction:
call FieldMoveJumptableReset
.loop
ld hl, .jumptable
call FieldMoveJumptable
jr nc, .loop
and $7f
ld [wFieldMoveSucceeded], a
ret
.jumptable:
dw .TryStrongArm
dw .DoStrongArm
dw .FailStrongArm
.TryStrongArm:
ld de, ENGINE_EARTHBADGE
farcall CheckBadge
jr c, .noearthbadge
call TryStrongArmMenu
jr c, .failed
ld a, $1
ret
.noearthbadge
ld a, $80
ret
.failed
ld a, $2
ret
.DoStrongArm:
ld hl, StrongArmFromMenuScript
call QueueScript
ld a, $81
ret
.FailStrongArm:
call FieldMoveFailed
ld a, $80
ret
TryStrongArmMenu:
call GetFacingTileCoord
ld c, a
push de
call CheckRockyWallTile
pop de
jr nz, .failed
xor a
ret
.failed
scf
ret
; You land here when you've successfully checked a wall.
TryStrongArmOW::
; First, check if you have the Earth Badge.
; You will, because you get the move afterwards, it just covers trading.
ld de, ENGINE_EARTHBADGE
call CheckEngineFlag
jr c, .cant_climb
; Now check if Strong Arm is in the party. This takes longer, thus the above going first.
ld d, STRONG_ARM
call CheckPartyMove
jr c, .cant_climb
ld a, BANK(AskStrongArmScript)
ld hl, AskStrongArmScript
call CallScript
scf
ret
.cant_climb
ld a, BANK(CantStrongArmScript)
ld hl, CantStrongArmScript
call CallScript
scf
ret
AskStrongArmScript:
opentext
writetext AskStrongArmText
yesorno
iftrue UsedStrongArmScript
closetext
end
CantStrongArmScript:
jumptext CantStrongArmText
StrongArmFromMenuScript:
reloadmappart
special UpdateTimePals
UsedStrongArmScript:
callasm GetPartyNickname ; BUG: When used in the OW, the Pokemon is picked wrong. Tested with Machamp and Furret in party, and Furret would always be picked, regardless of party position. Seems to be finding the wrong Pokemon in OW scenarios specifically. wStringBuffer2 is failing to update.
writetext UsedStrongArmText
closetext
loadvar VAR_MOVEMENT, PLAYER_NORMAL
special UpdatePlayerSprite
waitsfx
playsound SFX_STRENGTH
readvar VAR_FACING
if_equal DOWN, .Down
.loop_up
applymovement PLAYER, .StrongArmUpStep
callasm .CheckContinueStrongArm
iffalse .loop_up
end
.Down:
applymovement PLAYER, .StrongArmFixFacing
.loop_down
applymovement PLAYER, .StrongArmDownStep
callasm .CheckContinueStrongArm
iffalse .loop_down
applymovement PLAYER, .StrongArmRemoveFixedFacing
end
.CheckContinueStrongArm:
xor a
ld [wScriptVar], a
ld a, [wPlayerTile]
call CheckRockyWallTile
ret z
ld a, $1
ld [wScriptVar], a
ret
.StrongArmUpStep:
step UP
step_end
.StrongArmDownStep:
step DOWN
step_end
.StrongArmFixFacing:
turn_head UP
fix_facing
step_end
.StrongArmRemoveFixedFacing:
remove_fixed_facing
turn_head DOWN
step_end
AskStrongArmText:
text_far _AskStrongArmText
text_end
UsedStrongArmText:
text_far _UsedStrongArmText
text_end
CantStrongArmText:
text_far _CantStrongArmText
text_end
WaterSportFunction:
call FieldMoveJumptableReset
.loop
ld hl, .Jumptable
call FieldMoveJumptable
jr nc, .loop
and $7f
ld [wFieldMoveSucceeded], a
ret
.Jumptable:
dw .TryWaterSport
dw .DoWaterSport
dw .FailWaterSport
.TryWaterSport:
ld de, ENGINE_CASCADEBADGE
call CheckBadge
jr c, .nocascadebadge
call CheckMapCanWaterSport
jr nz, .cannotdive
ld a, $1
ret
.nocascadebadge
ld a, $80
ret
.cannotdive
ld a, $2
ret
.DoWaterSport:
call GetPartyNickname
ld hl, WaterSportFromMenuScript
call QueueScript
ld a, $81
ret
.FailWaterSport:
ld hl, CantWaterSportText
call MenuTextBoxBackup
ld a, $80
ret
CantWaterSportText:
text_jump _CantWaterSportText
db "@"
CheckMapCanWaterSport:
ld a, [wWaterSportMapGroup]
and a
jr z, .failed
ld a, [wWaterSportMapNumber]
and a
jr z, .failed
ld a, [wPlayerStandingTile]
call CheckWaterSportTile
jr nz, .failed
xor a
ret
.failed
scf
ret
TryWaterSportOW::
call CheckMapCanWaterSport
jr c, .failed
ld de, ENGINE_CASCADEBADGE
call CheckEngineFlag
jr c, .cant
ld d, DIVE
call CheckPartyMove
jr c, .cant
call GetPartyNick
ld a, BANK(AskWaterSportScript)
ld hl, AskWaterSportScript
call CallScript
scf
ret
.failed
xor a
ret
.cant
ld a, BANK(CantWaterSportScript)
ld hl, CantWaterSportScript
call CallScript
scf
ret
CantWaterSportScript:
jumptext CanWaterSportText
CanWaterSportText:
text_jump _CanWaterSportText
db "@"
AskWaterSportScript:
opentext
copybytetovar wPlayerStandingTile
ifequal COLL_DIVE_UP, .up
writetext AskWaterSportDownText
jump .continue
.up
writetext AskWaterSportUpText
.continue
yesorno
iftrue UsedWaterSportScript
closetext
end
AskWaterSportDownText:
text_jump _AskWaterSportDownText
db "@"
AskWaterSportUpText:
text_jump _AskWaterSportUpText
db "@"
WaterSportFromMenuScript:
special UpdateTimePals
UsedWaterSportScript:
writetext UsedWaterSportText
waitbutton
closetext
special FadeOutPalettes
waitsfx
divewarp
end
UsedWaterSportText:
text_jump _UsedWaterSportText
db "@"

View file

@ -1268,6 +1268,8 @@ LoadMapPals:
ld bc, 8 palettes
ld a, BANK(wOBPals1)
call FarCopyWRAM
farcall LoadSpecialMapObjectPalette
ld a, [wEnvironment]
cp TOWN

View file

@ -1143,13 +1143,22 @@ TryTileCollisionEvent::
.headbutt
ld a, [wFacingTileID]
call CheckHeadbuttTreeTile
jr nz, .surf
jr nz, .strong_arm
farcall TryHeadbuttOW
jr c, .done
jr .noevent
.strong_arm
ld a, [wFacingTileID]
call CheckRockyWallTile
jr nz, .surf
farcall TryStrongArmOW
jr .done
.surf
farcall TrySurfOW
jr c, .done
farcall TryWaterSportOW
jr nc, .noevent
jr .done

View file

@ -98,6 +98,8 @@ CheckUpdatePlayerSprite:
jr c, .ok
call .CheckSurfing
jr c, .ok
call .CheckDiving
jr c, .ok
call .CheckSurfing2
jr c, .ok
ret
@ -116,6 +118,18 @@ CheckUpdatePlayerSprite:
scf
ret
.CheckDiving:
ld a, [wMapTileset]
cp TILESET_UNDERWATER
jr nz, .not_underwater
ld a, PLAYER_WATER_SPORT
ld [wPlayerState], a
scf
ret
.not_underwater
and a
ret
.CheckSurfing2:
ld a, [wPlayerState]
cp PLAYER_NORMAL

View file

@ -33,6 +33,8 @@ DoPlayerMovement::
ld a, [wPlayerState]
cp PLAYER_NORMAL
jr z, .Normal
cp PLAYER_WATER_SPORT
jr z, .Normal
cp PLAYER_SURF
jr z, .Surf
cp PLAYER_SURF_PIKA

View file

@ -237,6 +237,8 @@ ScriptCommandTable:
dw Script_trainerpic ; aa
dw Script_loadmonindex ; ab
dw Script_checkmaplockedmons ; ac
dw Script_divemap
dw Script_divewarp
assert_table_length NUM_EVENT_COMMANDS
StartScript:
@ -2414,3 +2416,38 @@ LoadScriptPokemonID:
jp nz, GetPokemonIDFromIndex
ld a, [wScriptVar]
ret
Script_divemap:
call GetScriptByte
ld [wDiveMapGroup], a
call GetScriptByte
ld [wDiveMapNumber], a
call GetScriptByte
ld [wDiveDeltaX], a
call GetScriptByte
ld [wDiveDeltaY], a
ret
Script_divewarp:
ld a, [wDiveMapGroup]
ld [wMapGroup], a
ld a, [wDiveMapNumber]
ld [wMapNumber], a
ld a, [wXCoord]
ld b, a
ld a, [wDiveDeltaX]
add b
ld [wXCoord], a
ld a, [wYCoord]
ld b, a
ld a, [wDiveDeltaY]
add b
ld [wYCoord], a
ld a, -1
ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a
ld a, 1
call LoadMapStatus
call StopScript
ret

View file

@ -64,6 +64,7 @@ CheckGrassCollision::
db COLL_LONG_GRASS
db COLL_CUT_28
db COLL_WATER
db COLL_DIVE_DOWN
db COLL_GRASS_48
db COLL_GRASS_49
db COLL_GRASS_4A

View file

@ -4,6 +4,7 @@ HandleNewMap:
call ResetFlashIfOutOfCave
call GetCurrentMapSceneID
call ResetBikeFlags
call ResetDiveMap
call ResetMapLockedIDs
ld a, MAPCALLBACK_NEWMAP
call RunMapCallback

View file

@ -141,6 +141,11 @@ PokemonActionSubmenu:
dbw MONMENUITEM_WATERFALL, MonMenu_Waterfall
dbw MONMENUITEM_ROCKSMASH, MonMenu_RockSmash
dbw MONMENUITEM_SWEETSCENT, MonMenu_SweetScent
dbw MONMENUITEM_UPROOT, MonMenu_Uproot
dbw MONMENUITEM_WATER_SPORT,MonMenu_WaterSport
dbw MONMENUITEM_STRONG_ARM, MonMenu_StrongArm
dbw MONMENUITEM_BRIGHT_MOSS,MonMenu_BrightMoss
dbw MONMENUITEM_WIND_RIDE, MonMenu_WindRide
dbw MONMENUITEM_STATS, OpenPartyStats
dbw MONMENUITEM_SWITCH, SwitchPartyMons
dbw MONMENUITEM_ITEM, GiveTakePartyMonItem
@ -794,6 +799,43 @@ MonMenu_SweetScent:
ld a, $2
ret
MonMenu_Uproot:
ld a, $3 ; will be unused for now, so let's stay in the party menu
ret
MonMenu_WaterSport:
farcall WaterSportFunction
ld a, [wFieldMoveSucceeded]
cp $1
jr nz, .Fail
ld b, $4
ld a, $2
ret
.Fail:
ld a, $3
ret
MonMenu_StrongArm: ; just rock climb...
farcall StrongArmFunction
ld a, [wFieldMoveSucceeded]
cp $1
jr nz, .Fail
ld b, $4
ld a, $2
ret
.Fail:
ld a, $3
ret
MonMenu_BrightMoss:
ld a, $3 ; will be unused for now, so let's stay in the party menu
ret
MonMenu_WindRide:
ld a, $3 ; will be unused for now, so let's stay in the party menu
ret
ChooseMoveToDelete:
ld hl, wOptions
ld a, [hl]

View file

@ -38,7 +38,7 @@ _AnimateTileset::
Tileset0Anim:
TilesetJohtoModernAnim:
dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation
dw vTiles2 tile $5b, AnimateDeepWaterTile
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, AnimateWaterPalette
@ -357,6 +357,23 @@ TilesetNihonMartAnim:
dw NULL, WaitTileAnimation
dw NULL, DoneTileAnimation
; Currently unused.
; Zeta, you've made your own tileset, but check here and see what you want.
; https://github.com/Rangi42/pokecrystal/commit/c21561ea717feef9b2eb3785c2ea112cd0d19ba0#diff-88dbff1eb3920f69b17a3d5f613643e1a41096514706bc09f449e4aa637f20e4R5647
TilesetUnderwaterAnim:
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, UnderwaterBubbleTile
dw NULL, WaitTileAnimation
dw NULL, AnimateSeaweedTile1
dw NULL, AnimateSeaweedTile2
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, StandingTileFrame8
dw NULL, DoneTileAnimation
DoneTileAnimation:
; Reset the animation command loop.
xor a
@ -551,6 +568,32 @@ AnimateWaterTile:
.WaterTileFrames:
INCBIN "gfx/tilesets/water/water.2bpp"
AnimateDeepWaterTile:
; Draw a deep water tile for the current frame in VRAM tile at de.
; Save sp in bc (see WriteTile).
ld hl, sp+0
ld b, h
ld c, l
ld a, [wTileAnimationTimer]
; 4 tile graphics, updated every other frame.
and %110
; 2 x 8 = 16 bytes per tile
add a
add a
add a
add LOW(DeepWaterTileFrames)
ld l, a
ld a, 0
adc HIGH(DeepWaterTileFrames)
ld h, a
; The stack now points to the start of the tile for this frame.
ld sp, hl
ld l, e
ld h, d
jp WriteTile
DeepWaterTileFrames:
INCBIN "gfx/tilesets/water/deep-water.2bpp"
ForestTreeLeftAnimation:
; Save the stack pointer in bc for WriteTile to restore
ld hl, sp+0
@ -1124,3 +1167,76 @@ WhirlpoolTiles1: INCBIN "gfx/tilesets/whirlpool/1.2bpp"
WhirlpoolTiles2: INCBIN "gfx/tilesets/whirlpool/2.2bpp"
WhirlpoolTiles3: INCBIN "gfx/tilesets/whirlpool/3.2bpp"
WhirlpoolTiles4: INCBIN "gfx/tilesets/whirlpool/4.2bpp"
UnderwaterBubbleTile:
; No parameters.
; Save sp in bc (see WriteTile).
ld hl, sp+$0
ld b, h
ld c, l
; Alternate tile graphic every frame
ld a, [wTileAnimationTimer]
and %111 ; 8 frames
swap a ; * 16 bytes per tile
ld e, a
ld d, 0
ld hl, UnderwaterBubbleTileFrames
add hl, de
ld sp, hl
ld hl, vTiles2 tile $13 ; index of bubble tile
jp WriteTile
UnderwaterBubbleTileFrames:
INCBIN "gfx/tilesets/bubble/1.2bpp"
INCBIN "gfx/tilesets/bubble/2.2bpp"
INCBIN "gfx/tilesets/bubble/3.2bpp"
INCBIN "gfx/tilesets/bubble/4.2bpp"
INCBIN "gfx/tilesets/bubble/5.2bpp"
INCBIN "gfx/tilesets/bubble/5.2bpp"
INCBIN "gfx/tilesets/bubble/5.2bpp"
INCBIN "gfx/tilesets/bubble/5.2bpp"
AnimateSeaweedTile1:
; No parameters.
; Save sp in bc (see WriteTile).
ld hl, sp+$0
ld b, h
ld c, l
; Alternate tile graphic every eighth frame
ld a, [wTileAnimationTimer]
and %100
srl a
srl a
swap a ; * 16 bytes per tile
ld e, a
ld d, 0
ld hl, SeaweedTileFrames
add hl, de
ld sp, hl
ld hl, vTiles2 tile $03 ; index of seaweed tile 1
jp WriteTile
AnimateSeaweedTile2:
; No parameters.
; Save sp in bc (see WriteTile).
ld hl, sp+$0
ld b, h
ld c, l
; Alternate tile graphic every eighth frame
ld a, [wTileAnimationTimer]
xor %100 ; invert tile alternation from AnimateSeaweedTile1
and %100
srl a
srl a
swap a ; * 16 bytes per tile
ld e, a
ld d, 0
ld hl, SeaweedTileFrames
add hl, de
ld sp, hl
ld hl, vTiles2 tile $04 ; index of seaweed tile 2
jp WriteTile
SeaweedTileFrames:
INCBIN "gfx/tilesets/seaweed/1.2bpp"
INCBIN "gfx/tilesets/seaweed/2.2bpp"

View file

@ -1,3 +1,8 @@
; Zeta, Rangi's Dive code sets something special here.
; https://github.com/Rangi42/pokecrystal/commit/c21561ea717feef9b2eb3785c2ea112cd0d19ba0#diff-3f65a383d53b5b6bef93c0cf6b1078db365ec51031b8c9b8cccff1d8b81b77db
; Test and see if you like it; do so by adding the changes from the equivalent file.
; Requires underwater tileset to exist.
LoadSpecialMapPalette:
ld a, [wMapTileset]
cp TILESET_POKECOM_CENTER