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"