diff options
Diffstat (limited to 'engine/battle')
63 files changed, 14 insertions, 651 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index 14817f414..29bc23b20 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -145,13 +145,11 @@ SwitchSometimes: ld [wEnemySwitchMonIndex], a jp AI_TrySwitch - CheckSubstatusCantRun: ld a, [wEnemySubStatus5] bit SUBSTATUS_CANT_RUN, a ret - AI_TryItem: ; items are not allowed in the BattleTower ld a, [wInBattleTowerBattle] @@ -238,7 +236,6 @@ AI_TryItem: scf ret - .IsHighestLevel: ld a, [wOTPartyCount] ld d, a @@ -270,7 +267,6 @@ AI_TryItem: scf ret - AI_Items: dbw FULL_RESTORE, .FullRestore dbw MAX_POTION, .MaxPotion @@ -520,7 +516,6 @@ AI_Items: and a ret - AIUpdateHUD: call UpdateEnemyMonInParty farcall UpdateEnemyHUD @@ -538,7 +533,6 @@ AIUsedItemSound: pop de ret - EnemyUsedFullHeal: call AIUsedItemSound call AI_HealStatus @@ -642,7 +636,6 @@ EnemyPotionFinish: predef AnimateHPBar jp AIUpdateHUD - AI_TrySwitch: ; Determine whether the AI can switch based on how many Pokemon are still alive. ; If it can switch, it will. @@ -805,7 +798,6 @@ EnemyUsedXSpecial: ld b, SP_ATTACK ld a, X_SPECIAL - ; Parameter ; a = ITEM_CONSTANT ; b = BATTLE_CONSTANT (ATTACK, DEFENSE, SPEED, SP_ATTACK, SP_DEFENSE, ACCURACY, EVASION) @@ -817,7 +809,6 @@ EnemyUsedXItem: farcall CheckIfStatCanBeRaised jp AIUpdateHUD - ; Parameter ; a = ITEM_CONSTANT PrintText_UsedItemOn_AND_AIUpdateHUD: diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm index 488ea76ca..df0053141 100644 --- a/engine/battle/ai/move.asm +++ b/engine/battle/ai/move.asm @@ -15,7 +15,6 @@ AIChooseMove: farcall CheckEnemyLockedIn ret nz - ; The default score is 20. Unusable moves are given a score of 80. ld a, 20 ld hl, wBuffer1 @@ -61,7 +60,6 @@ AIChooseMove: ld [hl], 80 jr .CheckMovePP - ; Apply AI scoring layers depending on the trainer class. .ApplyLayers: ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS @@ -199,7 +197,6 @@ AIChooseMove: ld [wCurEnemyMoveNum], a ret - AIScoringPointers: ; entries correspond to AI_* constants dw AI_Basic diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 128e9841b..6928a3a83 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -65,7 +65,6 @@ AI_Basic: INCLUDE "data/battle/ai/status_only_effects.asm" - AI_Setup: ; Use stat-modifying moves on turn 1. @@ -141,7 +140,6 @@ AI_Setup: jr .checkmove - AI_Types: ; Dismiss any move that the player is immune to. ; Encourage super-effective moves. @@ -232,7 +230,6 @@ AI_Types: jr .checkmove - AI_Offensive: ; Greatly discourage non-damaging moves. @@ -260,7 +257,6 @@ AI_Offensive: jr .checkmove - AI_Smart: ; Context-specific scoring. @@ -392,7 +388,6 @@ AI_Smart: dbw EFFECT_FLY, AI_Smart_Fly db -1 ; end - AI_Smart_Sleep: ; Greatly encourage sleep inducing moves if the enemy has either Dream Eater or Nightmare. ; 50% chance to greatly encourage sleep inducing moves otherwise. @@ -412,7 +407,6 @@ AI_Smart_Sleep: dec [hl] ret - AI_Smart_LeechHit: push hl ld a, 1 @@ -447,7 +441,6 @@ AI_Smart_LeechHit: inc [hl] ret - AI_Smart_LockOn: ld a, [wPlayerSubStatus5] bit SUBSTATUS_LOCK_ON, a @@ -552,7 +545,6 @@ AI_Smart_LockOn: pop hl jp AIDiscourageMove - AI_Smart_Selfdestruct: ; Selfdestruct, Explosion @@ -589,7 +581,6 @@ AI_Smart_Selfdestruct: inc [hl] ret - AI_Smart_DreamEater: ; 90% chance to greatly encourage this move. ; The AI_Basic layer will make sure that @@ -602,9 +593,7 @@ AI_Smart_DreamEater: dec [hl] ret - AI_Smart_EvasionUp: - ; Dismiss this move if enemy's evasion can't raise anymore. ld a, [wEnemyEvaLevel] cp $d @@ -688,7 +677,6 @@ AI_Smart_EvasionUp: bit SUBSTATUS_ROLLOUT, a jr nz, .asm_388ef - .asm_38936 inc [hl] ret @@ -714,7 +702,6 @@ AI_Smart_EvasionUp: dec [hl] ret - AI_Smart_AlwaysHit: ; 80% chance to greatly encourage this move if either... @@ -736,9 +723,7 @@ AI_Smart_AlwaysHit: dec [hl] ret - AI_Smart_MirrorMove: - ; If the player did not use any move last turn... ld a, [wLastPlayerCounterMove] and a @@ -779,9 +764,7 @@ AI_Smart_MirrorMove: dec [hl] ret - AI_Smart_AccuracyDown: - ; If player's HP is full... call AICheckPlayerMaxHP jr nc, .asm_389a0 @@ -885,9 +868,7 @@ AI_Smart_AccuracyDown: dec [hl] ret - AI_Smart_ResetStats: - ; 85% chance to encourage this move if any of enemy's stat levels is lower than -2. push hl ld hl, wEnemyAtkLevel @@ -927,7 +908,6 @@ AI_Smart_ResetStats: inc [hl] ret - AI_Smart_Bide: ; 90% chance to discourage this move unless enemy's HP is full. @@ -939,7 +919,6 @@ AI_Smart_Bide: inc [hl] ret - AI_Smart_ForceSwitch: ; Whirlwind, Roar. @@ -956,7 +935,6 @@ AI_Smart_ForceSwitch: inc [hl] ret - AI_Smart_Heal: AI_Smart_MorningSun: AI_Smart_Synthesis: @@ -980,7 +958,6 @@ AI_Smart_Moonlight: dec [hl] ret - AI_Smart_Toxic: AI_Smart_LeechSeed: ; Discourage this move if player's HP is below 50%. @@ -990,7 +967,6 @@ AI_Smart_LeechSeed: inc [hl] ret - AI_Smart_LightScreen: AI_Smart_Reflect: ; Over 90% chance to discourage this move unless enemy's HP is full. @@ -1003,7 +979,6 @@ AI_Smart_Reflect: inc [hl] ret - AI_Smart_Ohko: ; Dismiss this move if player's level is higher than enemy's level. ; Else, discourage this move is player's HP is below 50%. @@ -1018,7 +993,6 @@ AI_Smart_Ohko: inc [hl] ret - AI_Smart_TrapTarget: ; Bind, Wrap, Fire Spin, Clamp @@ -1058,7 +1032,6 @@ AI_Smart_TrapTarget: dec [hl] ret - AI_Smart_RazorWind: AI_Smart_Unused2B: ld a, [wEnemySubStatus1] @@ -1112,9 +1085,7 @@ AI_Smart_Unused2B: ld [hl], a ret - AI_Smart_Confuse: - ; 90% chance to discourage this move if player's HP is between 25% and 50%. call AICheckPlayerHalfHP ret c @@ -1130,9 +1101,7 @@ AI_Smart_Confuse: inc [hl] ret - AI_Smart_SpDefenseUp2: - ; Discourage this move if enemy's HP is lower than 50%. call AICheckEnemyHalfHP jr nc, .asm_38b10 @@ -1165,7 +1134,6 @@ AI_Smart_SpDefenseUp2: inc [hl] ret - AI_Smart_Fly: ; Fly, Dig @@ -1184,7 +1152,6 @@ AI_Smart_Fly: dec [hl] ret - AI_Smart_SuperFang: ; Discourage this move if player's HP is below 25%. @@ -1193,9 +1160,7 @@ AI_Smart_SuperFang: inc [hl] ret - AI_Smart_Paralyze: - ; 50% chance to discourage this move if player's HP is below 25%. call AICheckPlayerQuarterHP jr nc, .asm_38b3a @@ -1218,7 +1183,6 @@ AI_Smart_Paralyze: inc [hl] ret - AI_Smart_SpeedDownHit: ; Icy Wind @@ -1244,7 +1208,6 @@ AI_Smart_SpeedDownHit: dec [hl] ret - AI_Smart_Substitute: ; Dismiss this move if enemy's HP is below 50%. @@ -1252,7 +1215,6 @@ AI_Smart_Substitute: ret c jp AIDiscourageMove - AI_Smart_HyperBeam: call AICheckEnemyHalfHP jr c, .asm_38b72 @@ -1276,7 +1238,6 @@ AI_Smart_HyperBeam: inc [hl] ret - AI_Smart_Rage: ld a, [wEnemySubStatus4] bit SUBSTATUS_RAGE, a @@ -1315,7 +1276,6 @@ AI_Smart_Rage: inc [hl] ret - AI_Smart_Mimic: ld a, [wLastPlayerCounterMove] and a @@ -1365,7 +1325,6 @@ AI_Smart_Mimic: inc [hl] ret - AI_Smart_Counter: push hl ld hl, wPlayerUsedMoves @@ -1415,7 +1374,6 @@ AI_Smart_Counter: cp SPECIAL jr nc, .asm_38c38 - .asm_38c30 call Random cp 39 percent + 1 @@ -1430,7 +1388,6 @@ AI_Smart_Counter: inc [hl] ret - AI_Smart_Encore: call AICompareSpeed jr nc, .asm_38c81 @@ -1484,7 +1441,6 @@ AI_Smart_Encore: INCLUDE "data/battle/ai/encore_moves.asm" - AI_Smart_PainSplit: ; Discourage this move if [enemy's current HP * 2 > player's current HP]. @@ -1505,7 +1461,6 @@ AI_Smart_PainSplit: inc [hl] ret - AI_Smart_Snore: AI_Smart_SleepTalk: ; Greatly encourage this move if enemy is fast asleep. @@ -1527,7 +1482,6 @@ AI_Smart_SleepTalk: inc [hl] ret - AI_Smart_DefrostOpponent: ; Greatly encourage this move if enemy is frozen. ; No move has EFFECT_DEFROST_OPPONENT, so this layer is unused. @@ -1540,7 +1494,6 @@ AI_Smart_DefrostOpponent: dec [hl] ret - AI_Smart_Spite: ld a, [wLastPlayerCounterMove] and a @@ -1597,11 +1550,9 @@ AI_Smart_Spite: dec [hl] ret - Function_0x38d16 jp AIDiscourageMove - AI_Smart_DestinyBond: AI_Smart_Reversal: AI_Smart_SkullBash: @@ -1612,7 +1563,6 @@ AI_Smart_SkullBash: inc [hl] ret - AI_Smart_HealBell: ; Dismiss this move if none of the opponent's Pokemon is statused. ; Encourage this move if the enemy is statused. @@ -1670,7 +1620,6 @@ AI_Smart_HealBell: jp AIDiscourageMove - AI_Smart_PriorityHit: call AICompareSpeed ret c @@ -1702,7 +1651,6 @@ AI_Smart_PriorityHit: dec [hl] ret - AI_Smart_Thief: ; Don't use Thief unless it's the only move available. @@ -1711,7 +1659,6 @@ AI_Smart_Thief: ld [hl], a ret - AI_Smart_Conversion2: ld a, [wLastPlayerMove] and a @@ -1751,7 +1698,6 @@ AI_Smart_Conversion2: inc [hl] ret - AI_Smart_Disable: call AICompareSpeed jr nc, .asm_38df3 @@ -1783,7 +1729,6 @@ AI_Smart_Disable: inc [hl] ret - AI_Smart_MeanLook: call AICheckEnemyHalfHP jr nc, .asm_38e24 @@ -1825,7 +1770,6 @@ AI_Smart_MeanLook: dec [hl] ret - AICheckLastPlayerMon: ld a, [wPartyCount] ld b, a @@ -1851,7 +1795,6 @@ AICheckLastPlayerMon: ret - AI_Smart_Nightmare: ; 50% chance to encourage this move. ; The AI_Basic layer will make sure that @@ -1862,7 +1805,6 @@ AI_Smart_Nightmare: dec [hl] ret - AI_Smart_FlameWheel: ; Use this move if the enemy is frozen. @@ -1874,7 +1816,6 @@ rept 5 endr ret - AI_Smart_Curse: ld a, [wEnemyMonType1] cp GHOST @@ -1932,14 +1873,12 @@ AI_Smart_Curse: jr .asm_38eb7 - .asm_38eb0 push hl call AICheckLastPlayerMon pop hl jr z, .asm_38ecb - .asm_38eb7 call AICheckEnemyQuarterHP jp nc, .asm_38e90 @@ -1962,7 +1901,6 @@ AI_Smart_Curse: dec [hl] ret - AI_Smart_Protect: ld a, [wEnemyProtectCount] and a @@ -2014,7 +1952,6 @@ AI_Smart_Protect: inc [hl] ret - AI_Smart_Foresight: ld a, [wEnemyAccLevel] cp $5 @@ -2044,7 +1981,6 @@ AI_Smart_Foresight: dec [hl] ret - AI_Smart_PerishSong: push hl callfar FindAliveEnemyMons @@ -2081,9 +2017,7 @@ AI_Smart_PerishSong: ld [hl], a ret - AI_Smart_Sandstorm: - ; Greatly discourage this move if the player is immune to Sandstorm damage. ld a, [wBattleMonType1] push hl @@ -2125,7 +2059,6 @@ AI_Smart_Sandstorm: db STEEL db -1 ; end - AI_Smart_Endure: ld a, [wEnemyProtectCount] and a @@ -2168,7 +2101,6 @@ AI_Smart_Endure: inc [hl] ret - AI_Smart_FuryCutter: ; Encourage this move based on Fury Cutter's count. @@ -2192,7 +2124,6 @@ AI_Smart_FuryCutter: ; fallthrough - AI_Smart_Rollout: ; Rollout, Fury Cutter @@ -2235,7 +2166,6 @@ AI_Smart_Rollout: inc [hl] ret - AI_Smart_Swagger: AI_Smart_Attract: ; 80% chance to encourage this move during the first turn of player's Pokemon. @@ -2257,7 +2187,6 @@ AI_Smart_Attract: dec [hl] ret - AI_Smart_Safeguard: ; 80% chance to discourage this move if player's HP is below 50%. @@ -2268,10 +2197,8 @@ AI_Smart_Safeguard: inc [hl] ret - AI_Smart_Magnitude: AI_Smart_Earthquake: - ; Greatly encourage this move if the player is underground and the enemy is faster. ld a, [wLastPlayerCounterMove] cp DIG @@ -2300,7 +2227,6 @@ AI_Smart_Earthquake: dec [hl] ret - AI_Smart_BatonPass: ; Discourage this move if the player hasn't shown super-effective moves against the enemy. ; Consider player's type(s) if its moves are unknown. @@ -2314,7 +2240,6 @@ AI_Smart_BatonPass: inc [hl] ret - AI_Smart_Pursuit: ; 50% chance to greatly encourage this move if player's HP is below 25%. ; 80% chance to discourage this move otherwise. @@ -2333,7 +2258,6 @@ AI_Smart_Pursuit: dec [hl] ret - AI_Smart_RapidSpin: ; 80% chance to greatly encourage this move if the enemy is ; trapped (Bind effect), seeded, or scattered with spikes. @@ -2358,7 +2282,6 @@ AI_Smart_RapidSpin: dec [hl] ret - AI_Smart_HiddenPower: push hl ld a, 1 @@ -2397,9 +2320,7 @@ AI_Smart_HiddenPower: inc [hl] ret - AI_Smart_RainDance: - ; Greatly discourage this move if it would favour the player type-wise. ; Particularly, if the player is a Water-type. ld a, [wBattleMonType1] @@ -2420,9 +2341,7 @@ AI_Smart_RainDance: INCLUDE "data/battle/ai/rain_dance_moves.asm" - AI_Smart_SunnyDay: - ; Greatly discourage this move if it would favour the player type-wise. ; Particularly, if the player is a Fire-type. ld a, [wBattleMonType1] @@ -2442,7 +2361,6 @@ AI_Smart_SunnyDay: ; fallthrough - AI_Smart_WeatherMove: ; Rain Dance, Sunny Day @@ -2492,10 +2410,8 @@ AIGoodWeatherType: dec [hl] ret - INCLUDE "data/battle/ai/sunny_day_moves.asm" - AI_Smart_BellyDrum: ; Dismiss this move if enemy's attack is higher than +2 or if enemy's HP is below 50%. ; Else, discourage this move if enemy's HP is not full. @@ -2518,7 +2434,6 @@ AI_Smart_BellyDrum: ld [hl], a ret - AI_Smart_PsychUp: push hl ld hl, wEnemyAtkLevel @@ -2576,7 +2491,6 @@ AI_Smart_PsychUp: inc [hl] ret - AI_Smart_MirrorCoat: push hl ld hl, wPlayerUsedMoves @@ -2626,7 +2540,6 @@ AI_Smart_MirrorCoat: cp SPECIAL jr c, .asm_391d2 - .asm_391ca call Random cp 100 @@ -2640,10 +2553,8 @@ AI_Smart_MirrorCoat: inc [hl] ret - AI_Smart_Twister: AI_Smart_Gust: - ; Greatly encourage this move if the player is flying and the enemy is faster. ld a, [wLastPlayerCounterMove] cp FLY @@ -2671,7 +2582,6 @@ AI_Smart_Gust: dec [hl] ret - AI_Smart_FutureSight: ; Greatly encourage this move if the player is ; flying or underground, and slower than the enemy. @@ -2687,7 +2597,6 @@ AI_Smart_FutureSight: dec [hl] ret - AI_Smart_Stomp: ; 80% chance to encourage this move if the player has used Minimize. @@ -2701,7 +2610,6 @@ AI_Smart_Stomp: dec [hl] ret - AI_Smart_Solarbeam: ; 80% chance to encourage this move when it's sunny. ; 90% chance to discourage this move when it's raining. @@ -2729,7 +2637,6 @@ AI_Smart_Solarbeam: dec [hl] ret - AI_Smart_Thunder: ; 90% chance to discourage this move when it's sunny. @@ -2744,7 +2651,6 @@ AI_Smart_Thunder: inc [hl] ret - AICompareSpeed: ; Return carry if enemy is faster than player. @@ -2760,7 +2666,6 @@ AICompareSpeed: pop bc ret - AICheckPlayerMaxHP: push hl push de @@ -2769,7 +2674,6 @@ AICheckPlayerMaxHP: ld hl, wBattleMonMaxHP jr AICheckMaxHP - AICheckEnemyMaxHP: push hl push de @@ -2778,7 +2682,6 @@ AICheckEnemyMaxHP: ld hl, wEnemyMonMaxHP ; fallthrough - AICheckMaxHP: ; Return carry if hp at de matches max hp at hl. @@ -2805,7 +2708,6 @@ AICheckMaxHP: and a ret - AICheckPlayerHalfHP: push hl ld hl, wBattleMonHP @@ -2823,7 +2725,6 @@ AICheckPlayerHalfHP: pop hl ret - AICheckEnemyHalfHP: push hl push de @@ -2845,7 +2746,6 @@ AICheckEnemyHalfHP: pop hl ret - AICheckEnemyQuarterHP: push hl push de @@ -2869,7 +2769,6 @@ AICheckEnemyQuarterHP: pop hl ret - AICheckPlayerQuarterHP: push hl ld hl, wBattleMonHP @@ -2889,7 +2788,6 @@ AICheckPlayerQuarterHP: pop hl ret - AIHasMoveEffect: ; Return carry if the enemy has move b. @@ -2921,7 +2819,6 @@ AIHasMoveEffect: scf ret - AIHasMoveInArray: ; Return carry if the enemy has a move in array hl. @@ -2955,10 +2852,8 @@ AIHasMoveInArray: pop hl ret - INCLUDE "data/battle/ai/useful_moves.asm" - AI_Opportunist: ; Discourage stall moves when the enemy's HP is low. @@ -3009,7 +2904,6 @@ AI_Opportunist: INCLUDE "data/battle/ai/stall_moves.asm" - AI_Aggressive: ; Use whatever does the most damage. @@ -3117,7 +3011,6 @@ AI_Aggressive: INCLUDE "data/battle/ai/reckless_moves.asm" - AIDamageCalc: ld a, 1 ld [hBattleTurn], a @@ -3137,7 +3030,6 @@ AIDamageCalc: INCLUDE "data/battle/ai/constant_damage_effects.asm" - AI_Cautious: ; 90% chance to discourage moves with residual effects after the first turn. @@ -3180,7 +3072,6 @@ AI_Cautious: INCLUDE "data/battle/ai/residual_moves.asm" - AI_Status: ; Dismiss status moves that don't affect the player. @@ -3243,7 +3134,6 @@ AI_Status: jr .checkmove - AI_Risky: ; Use any move that will KO the target. ; Risky moves will often be an exception (see below). @@ -3313,18 +3203,15 @@ endr INCLUDE "data/battle/ai/risky_effects.asm" - AI_None: ret - AIDiscourageMove: ld a, [hl] add 10 ld [hl], a ret - AIGetEnemyMove: ; Load attributes of move a into ram @@ -3345,13 +3232,11 @@ AIGetEnemyMove: pop hl ret - AI_80_20: call Random cp 20 percent - 1 ret - AI_50_50: call Random cp 50 percent + 1 diff --git a/engine/battle/ai/switch.asm b/engine/battle/ai/switch.asm index b975776c2..b9bd2ea60 100644 --- a/engine/battle/ai/switch.asm +++ b/engine/battle/ai/switch.asm @@ -96,7 +96,6 @@ CheckPlayerMoveTypeMatchups: pop hl ret - .CheckEnemyMoveMatchups: ld de, wEnemyMonMoves ld b, NUM_MOVES + 1 @@ -290,7 +289,6 @@ CheckAbleToSwitch: ld [wEnemySwitchMonParam], a ret - FindAliveEnemyMons: ld a, [wOTPartyCount] cp 2 @@ -341,7 +339,6 @@ FindAliveEnemyMons: and a ret - FindEnemyMonsImmuneToLastCounterMove: ld hl, wOTPartyMon1 ld a, [wOTPartyCount] @@ -408,7 +405,6 @@ FindEnemyMonsImmuneToLastCounterMove: srl c jr .loop - FindAliveEnemyMonsWithASuperEffectiveMove: push bc ld a, [wOTPartyCount] @@ -439,8 +435,9 @@ FindAliveEnemyMonsWithASuperEffectiveMove: and c ld c, a -FindEnemyMonsWithASuperEffectiveMove: + ; fallthrough +FindEnemyMonsWithASuperEffectiveMove: ld a, -1 ld [wEnemyAISwitchScore], a ld hl, wOTPartyMon1Moves @@ -546,7 +543,6 @@ FindEnemyMonsWithASuperEffectiveMove: pop bc ret - FindEnemyMonsThatResistPlayer: push bc ld hl, wOTPartySpecies @@ -607,7 +603,6 @@ FindEnemyMonsThatResistPlayer: ld c, a ret - FindEnemyMonsWithAtLeastQuarterMaxHP: push bc ld de, wOTPartySpecies diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 3a9749b03..8747f46a6 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -6,6 +6,8 @@ BATTLETRANSITION_NO_CAVE_STRONGER EQU $18 BATTLETRANSITION_FINISH EQU $20 BATTLETRANSITION_END EQU $80 +BATTLETRANSITION_SQUARE EQUS "\"8\"" ; $fe + DoBattleTransition: call .InitGFX ld a, [rBGP] @@ -97,7 +99,7 @@ LoadTrainerBattlePokeballTiles: ; Load the tiles used in the Pokeball Graphic that fills the screen ; at the start of every Trainer battle. ld de, TrainerBattlePokeballTiles - ld hl, vTiles1 tile $7e + ld hl, vTiles0 tile BATTLETRANSITION_SQUARE ld b, BANK(TrainerBattlePokeballTiles) ld c, 2 call Request2bpp @@ -108,7 +110,7 @@ LoadTrainerBattlePokeballTiles: ld [rVBK], a ld de, TrainerBattlePokeballTiles - ld hl, vTiles4 tile $7e + ld hl, vTiles3 tile BATTLETRANSITION_SQUARE ld b, BANK(TrainerBattlePokeballTiles) ld c, 2 call Request2bpp @@ -146,7 +148,6 @@ ConvertTrainerBattlePokeballTilesTo2bpp: TrainerBattlePokeballTiles: INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp" - BattleTransitionJumptable: jumptable .Jumptable, wJumptableIndex @@ -617,7 +618,7 @@ StartTrainerBattle_LoadPokeBallGraphics: jr z, .done sla a jr nc, .no_load - ld [hl], $fe + ld [hl], BATTLETRANSITION_SQUARE .no_load inc hl jr .loop4 @@ -753,7 +754,6 @@ WipeLYOverrides: jr nz, .loop ret - StartTrainerBattle_DrawSineWave: calc_sine_wave diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 902846bdc..c3c7e9867 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6036,7 +6036,6 @@ LoadEnemyMon: jp .Happiness .InitDVs: - ; Trainer DVs ; All trainers have preset DVs, determined by class @@ -6486,7 +6485,6 @@ CheckUnownLetter: INCLUDE "data/wild/unlocked_unowns.asm" - Unreferenced_SwapBattlerLevels: push bc ld a, [wBattleMonLevel] diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 07e8b3a2a..3e6d928d2 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -7,8 +7,6 @@ DoPlayerTurn: jr DoTurn - - DoEnemyTurn: call SetEnemyTurn @@ -24,7 +22,6 @@ DoEnemyTurn: ; fallthrough - DoTurn: ; Read in and execute the user's move effects for this turn. @@ -40,7 +37,6 @@ DoTurn: call UpdateMoveData - DoMove: ; Get the user's move effect. ld a, BATTLE_VARS_MOVE_EFFECT @@ -72,7 +68,6 @@ DoMove: ld [wBattleScriptBufferAddress + 1], a .ReadMoveEffectCommand: - ; ld a, [wBattleScriptBufferAddress++] ld a, [wBattleScriptBufferAddress] ld l, a @@ -112,8 +107,6 @@ DoMove: .DoMoveEffectCommand: jp hl - - CheckTurn: BattleCommand_CheckTurn: ; checkturn @@ -141,9 +134,7 @@ BattleCommand_CheckTurn: and a jp nz, CheckEnemyTurn - CheckPlayerTurn: - ld hl, wPlayerSubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -156,7 +147,6 @@ CheckPlayerTurn: .no_recharge - ld hl, wBattleMonStatus ld a, [hl] and SLP @@ -202,7 +192,6 @@ CheckPlayerTurn: .not_asleep - ld hl, wBattleMonStatus bit FRZ, [hl] jr z, .not_frozen @@ -222,7 +211,6 @@ CheckPlayerTurn: .not_frozen - ld hl, wPlayerSubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -236,7 +224,6 @@ CheckPlayerTurn: .not_flinched - ld hl, wPlayerDisableCount ld a, [hl] and a @@ -254,7 +241,6 @@ CheckPlayerTurn: .not_disabled - ld a, [wPlayerSubStatus3] add a jr nc, .not_confused @@ -293,7 +279,6 @@ CheckPlayerTurn: .not_confused - ld a, [wPlayerSubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -317,7 +302,6 @@ CheckPlayerTurn: .not_infatuated - ; We can't disable a move that doesn't exist. ld a, [wDisabledMove] and a @@ -334,7 +318,6 @@ CheckPlayerTurn: .no_disabled_move - ld hl, wBattleMonStatus bit PAR, [hl] ret z @@ -349,8 +332,6 @@ CheckPlayerTurn: call CantMove jp EndTurn - - CantMove: ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVarAddr @@ -377,19 +358,12 @@ CantMove: res SUBSTATUS_FLYING, [hl] jp AppearUserRaiseSub - - - OpponentCantMove: call BattleCommand_SwitchTurn call CantMove jp BattleCommand_SwitchTurn - - - CheckEnemyTurn: - ld hl, wEnemySubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -402,7 +376,6 @@ CheckEnemyTurn: .no_recharge - ld hl, wEnemyMonStatus ld a, [hl] and SLP @@ -446,7 +419,6 @@ CheckEnemyTurn: .not_asleep - ld hl, wEnemyMonStatus bit FRZ, [hl] jr z, .not_frozen @@ -465,7 +437,6 @@ CheckEnemyTurn: .not_frozen - ld hl, wEnemySubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -479,7 +450,6 @@ CheckEnemyTurn: .not_flinched - ld hl, wEnemyDisableCount ld a, [hl] and a @@ -498,7 +468,6 @@ CheckEnemyTurn: .not_disabled - ld a, [wEnemySubStatus3] add a ; bit SUBSTATUS_CONFUSED jr nc, .not_confused @@ -513,7 +482,6 @@ CheckEnemyTurn: call StdBattleTextBox jr .not_confused - .confused ld hl, IsConfusedText call StdBattleTextBox @@ -557,7 +525,6 @@ CheckEnemyTurn: .not_confused - ld a, [wEnemySubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -581,7 +548,6 @@ CheckEnemyTurn: .not_infatuated - ; We can't disable a move that doesn't exist. ld a, [wEnemyDisabledMove] and a @@ -599,7 +565,6 @@ CheckEnemyTurn: .no_disabled_move - ld hl, wEnemyMonStatus bit PAR, [hl] ret z @@ -615,16 +580,12 @@ CheckEnemyTurn: ; fallthrough - EndTurn: ld a, $1 ld [wTurnEnded], a jp ResetDamage - - MoveDisabled: - ; Make sure any charged moves fail ld a, BATTLE_VARS_SUBSTATUS3 call GetBattleVarAddr @@ -638,10 +599,7 @@ MoveDisabled: ld hl, DisabledMoveText jp StdBattleTextBox - - HitConfusion: - ld hl, HurtItselfText call StdBattleTextBox @@ -670,8 +628,6 @@ HitConfusion: call DoPlayerDamage jp BattleCommand_RaiseSub - - BattleCommand_CheckObedience: ; checkobedience @@ -714,7 +670,6 @@ BattleCommand_CheckObedience: cp [hl] ret z - .obeylevel ; The maximum obedience level is constrained by owned badges: ld hl, wJohtoBadges @@ -742,7 +697,6 @@ BattleCommand_CheckObedience: ; no badges ld a, 10 - .getlevel ; c = obedience level ; d = monster level @@ -761,14 +715,12 @@ BattleCommand_CheckObedience: jr nc, .checklevel ld b, $ff - .checklevel ; If the monster's level is lower than the obedience level, it will obey. ld a, c cp d ret nc - ; Random number from 0 to obedience level + monster level .rand1 call BattleRandom @@ -786,7 +738,6 @@ BattleCommand_CheckObedience: call IgnoreSleepOnly ret c - ; Another random number from 0 to obedience level + monster level .rand2 call BattleRandom @@ -797,7 +748,6 @@ BattleCommand_CheckObedience: cp c jr c, .UseInstead - ; No hope of using a move now. ; b = number of levels the monster is above the obedience level @@ -820,7 +770,6 @@ BattleCommand_CheckObedience: call HitConfusion jp .EndDisobedience - .Nap: call BattleRandom add a @@ -833,7 +782,6 @@ BattleCommand_CheckObedience: ld hl, BeganToNapText jr .Print - .DoNothing: ; 4 random choices call BattleRandom @@ -857,9 +805,7 @@ BattleCommand_CheckObedience: call StdBattleTextBox jp .EndDisobedience - .UseInstead: - ; Can't use another move if the monster only has one! ld a, [wBattleMonMoves + 1] and a @@ -870,7 +816,6 @@ BattleCommand_CheckObedience: and a jr nz, .DoNothing - ld hl, wBattleMonPP ld de, wBattleMonMoves ld b, 0 @@ -891,7 +836,6 @@ BattleCommand_CheckObedience: and a jr nz, .GetTotalPP - .CheckMovePP: ld hl, wBattleMonPP ld a, [wCurMoveNum] @@ -905,7 +849,6 @@ BattleCommand_CheckObedience: cp b jr z, .DoNothing - ; Make sure we can actually use the move once we get there. ld a, 1 ld [wAlreadyDisobeyed], a @@ -918,7 +861,6 @@ BattleCommand_CheckObedience: ld c, a push af - .RandomMove: call BattleRandom maskbits NUM_MOVES @@ -940,7 +882,6 @@ BattleCommand_CheckObedience: and PP_MASK jr z, .RandomMove - ; Use it. ld a, [wCurMoveNum] ld c, a @@ -954,12 +895,10 @@ BattleCommand_CheckObedience: call UpdateMoveData call DoMove - ; Restore original move choice. pop af ld [wCurMoveNum], a - .EndDisobedience: xor a ld [wLastPlayerMove], a @@ -973,10 +912,7 @@ BattleCommand_CheckObedience: jp EndMoveEffect - - IgnoreSleepOnly: - ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -1003,17 +939,12 @@ IgnoreSleepOnly: scf ret - - BattleCommand_UsedMoveText: ; usedmovetext farcall DisplayUsedMoveText ret - - CheckUserIsCharging: - ld a, [hBattleTurn] and a ld a, [wPlayerCharging] ; player @@ -1023,8 +954,6 @@ CheckUserIsCharging: and a ret - - BattleCommand_DoTurn: call CheckUserIsCharging ret nz @@ -1150,7 +1079,6 @@ BattleCommand_DoTurn: ld b, 1 ret - .continuousmoves db EFFECT_RAZOR_WIND db EFFECT_SKY_ATTACK @@ -1192,8 +1120,6 @@ CheckMimicUsed: and a ret - - BattleCommand_Critical: ; critical @@ -1286,10 +1212,8 @@ BattleCommand_Critical: INCLUDE "data/battle/critical_hits.asm" - INCLUDE "engine/battle/move_effects/triple_kick.asm" - BattleCommand_Stab: ; STAB = Same Type Attack Bonus ld a, BATTLE_VARS_MOVE_ANIM @@ -1474,8 +1398,6 @@ BattleCommand_Stab: ld [wTypeModifier], a ret - - BattleCheckTypeMatchup: ld hl, wEnemyMonType1 ld a, [hBattleTurn] @@ -1555,8 +1477,6 @@ CheckTypeMatchup: pop hl ret - - BattleCommand_ResetTypeMatchup: ; Reset the type matchup multiplier to 1.0, if the type matchup is not 0. ; If there is immunity in play, the move automatically misses. @@ -1576,13 +1496,10 @@ BattleCommand_ResetTypeMatchup: ld [wTypeMatchup], a ret - - INCLUDE "engine/battle/ai/switch.asm" INCLUDE "data/types/type_matchups.asm" - BattleCommand_DamageVariation: ; damagevariation @@ -1592,7 +1509,6 @@ BattleCommand_DamageVariation: ; is not consistent. This makes the highest damage multipliers ; rarer than normal. - ; No point in reducing 1 or 0 damage. ld hl, wCurDamage ld a, [hli] @@ -1636,8 +1552,6 @@ BattleCommand_DamageVariation: ld [hl], a ret - - BattleCommand_CheckHit: ; checkhit @@ -1706,7 +1620,6 @@ BattleCommand_CheckHit: .Hit: ret - .Miss: ; Keep the damage value intact if we're using (Hi) Jump Kick. ld a, BATTLE_VARS_MOVE_EFFECT @@ -1720,7 +1633,6 @@ BattleCommand_CheckHit: ld [wAttackMissed], a ret - .DreamEater: ; Return z if we're trying to eat the dream of ; a monster that isn't sleeping. @@ -1734,7 +1646,6 @@ BattleCommand_CheckHit: and SLP ret - .Protect: ; Return nz if the opponent is protected. ld a, BATTLE_VARS_SUBSTATUS1_OPP @@ -1756,7 +1667,6 @@ BattleCommand_CheckHit: and a ret - .LockOn: ; Return nz if we are locked-on and aren't trying to use Earthquake, ; Fissure or Magnitude on a monster that is flying. @@ -1786,7 +1696,6 @@ BattleCommand_CheckHit: and a ret - .DrainSub: ; Return z if using an HP drain move on a substitute. call CheckSubstituteOpp @@ -1805,7 +1714,6 @@ BattleCommand_CheckHit: and a ret - .FlyDigMoves: ; Check for moves that can hit underground/flying opponents. ; Return z if the current move can hit the opponent. @@ -1841,7 +1749,6 @@ BattleCommand_CheckHit: cp MAGNITUDE ret - .ThunderRain: ; Return z if the current move always hits in rain, and it is raining. ld a, BATTLE_VARS_MOVE_EFFECT @@ -1853,16 +1760,13 @@ BattleCommand_CheckHit: cp WEATHER_RAIN ret - .XAccuracy: ld a, BATTLE_VARS_SUBSTATUS4 call GetBattleVar bit SUBSTATUS_X_ACCURACY, a ret - .StatModifiers: - ld a, [hBattleTurn] and a @@ -1955,7 +1859,6 @@ BattleCommand_CheckHit: INCLUDE "data/battle/accuracy_multipliers.asm" - BattleCommand_EffectChance: ; effectchance @@ -1983,8 +1886,6 @@ BattleCommand_EffectChance: and a ret - - BattleCommand_LowerSub: ; lowersub @@ -2053,16 +1954,12 @@ BattleCommand_LowerSub: ld [wSomeoneIsRampaging], a ret - - BattleCommand_MoveAnim: ; moveanim call BattleCommand_LowerSub call BattleCommand_MoveAnimNoSub jp BattleCommand_RaiseSub - - BattleCommand_MoveAnimNoSub: ld a, [wAttackMissed] and a @@ -2127,8 +2024,6 @@ BattleCommand_MoveAnimNoSub: ld [wNumHits], a jp PlayFXAnimID - - BattleCommand_StatUpAnim: ld a, [wAttackMissed] and a @@ -2137,8 +2032,6 @@ BattleCommand_StatUpAnim: xor a jr BattleCommand_StatUpDownAnim - - BattleCommand_StatDownAnim: ld a, [wAttackMissed] and a @@ -2152,7 +2045,6 @@ BattleCommand_StatDownAnim: ; fallthrough - BattleCommand_StatUpDownAnim: ld [wNumHits], a xor a @@ -2163,8 +2055,6 @@ BattleCommand_StatUpDownAnim: ld d, 0 jp PlayFXAnimID - - BattleCommand_SwitchTurn: ; switchturn @@ -2173,8 +2063,6 @@ BattleCommand_SwitchTurn: ld [hBattleTurn], a ret - - BattleCommand_RaiseSub: ; raisesub @@ -2194,8 +2082,6 @@ BattleCommand_RaiseSub: ld a, SUBSTITUTE jp LoadAnim - - BattleCommand_FailureText: ; failuretext ; If the move missed or failed, load the appropriate @@ -2238,8 +2124,6 @@ BattleCommand_FailureText: call AppearUserRaiseSub jp EndMoveEffect - - BattleCommand_ApplyDamage: ; applydamage @@ -2332,8 +2216,6 @@ BattleCommand_ApplyDamage: ld [de], a ret - - GetFailureResultText: ld hl, DoesntAffectText ld de, DoesntAffectText @@ -2402,8 +2284,6 @@ FailText_CheckOpponentProtect: .not_protected jp StdBattleTextBox - - BattleCommand_BideFailText: ld a, [wAttackMissed] and a @@ -2414,8 +2294,6 @@ BattleCommand_BideFailText: jp z, PrintDoesntAffect jp PrintButItFailed - - BattleCommand_CriticalText: ; criticaltext ; Prints the message for critical hits or one-hit KOs. @@ -2447,7 +2325,6 @@ BattleCommand_CriticalText: dw CriticalHitText dw OneHitKOText - BattleCommand_StartLoop: ; startloop @@ -2461,8 +2338,6 @@ BattleCommand_StartLoop: ld [hl], a ret - - BattleCommand_SuperEffectiveLoopText: ; supereffectivelooptext @@ -2473,7 +2348,6 @@ BattleCommand_SuperEffectiveLoopText: ; fallthrough - BattleCommand_SuperEffectiveText: ; supereffectivetext @@ -2487,8 +2361,6 @@ BattleCommand_SuperEffectiveText: .print jp StdBattleTextBox - - BattleCommand_CheckDestinyBond: ; checkdestinybond @@ -2576,8 +2448,6 @@ BattleCommand_CheckDestinyBond: .finish jp EndMoveEffect - - BattleCommand_BuildOpponentRage: ; buildopponentrage @@ -2609,8 +2479,6 @@ BattleCommand_BuildOpponentRage: call StdBattleTextBox jp BattleCommand_SwitchTurn - - BattleCommand_RageDamage: ; ragedamage @@ -2639,8 +2507,6 @@ BattleCommand_RageDamage: ld [wCurDamage + 1], a ret - - EndMoveEffect: ld a, [wBattleScriptBufferAddress] ld l, a @@ -2652,8 +2518,6 @@ EndMoveEffect: ld [hl], a ret - - DittoMetalPowder: ld a, MON_SPECIES call BattlePartyAttr @@ -2690,8 +2554,6 @@ DittoMetalPowder: rr c ret - - BattleCommand_DamageStats: ; damagestats @@ -2701,7 +2563,6 @@ BattleCommand_DamageStats: ; fallthrough - PlayerAttackDamage: ; Return move power d, player level e, enemy defense c and player attack b. @@ -2784,8 +2645,6 @@ PlayerAttackDamage: and a ret - - TruncateHL_BC: .loop ; Truncate 16-bit values hl and bc to 8-bit values b and c respectively. @@ -2831,8 +2690,6 @@ TruncateHL_BC: ld b, l ret - - GetDamageStatsCritical: ; Return carry if non-critical. @@ -2843,7 +2700,6 @@ GetDamageStatsCritical: ; fallthrough - GetDamageStats: ; Return the attacker's offensive stat and the defender's defensive ; stat based on whether the attacking type is physical or special. @@ -2884,8 +2740,6 @@ GetDamageStats: pop hl ret - - ThickClubBoost: ; Return in hl the stat value at hl. @@ -2901,8 +2755,6 @@ ThickClubBoost: pop bc ret - - LightBallBoost: ; Return in hl the stat value at hl. @@ -2918,8 +2770,6 @@ LightBallBoost: pop bc ret - - SpeciesItemBoost: ; Return in hl the stat value at hl. @@ -2960,8 +2810,6 @@ SpeciesItemBoost: rl h ret - - EnemyAttackDamage: call ResetDamage @@ -3040,11 +2888,8 @@ EnemyAttackDamage: and a ret - - INCLUDE "engine/battle/move_effects/beat_up.asm" - BattleCommand_ClearMissDamage: ; clearmissdamage ld a, [wAttackMissed] @@ -3053,8 +2898,6 @@ BattleCommand_ClearMissDamage: jp ResetDamage - - HitSelfInConfusion: call ResetDamage ld a, [hBattleTurn] @@ -3091,8 +2934,6 @@ HitSelfInConfusion: ld e, a ret - - BattleCommand_DamageCalc: ; damagecalc @@ -3216,12 +3057,11 @@ BattleCommand_DamageCalc: ld [hDivisor], a ld b, 4 call Divide -.DoneItem: +.DoneItem: ; Critical hits call .CriticalMultiplier - ; Update wCurDamage (capped at 997). ld hl, wCurDamage ld b, [hl] @@ -3286,7 +3126,6 @@ BattleCommand_DamageCalc: ld a, LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE) ld [hld], a - .dont_cap_3 ; Minimum neutral damage is 2 (bringing the cap to 999). inc hl @@ -3301,7 +3140,6 @@ BattleCommand_DamageCalc: and a ret - .CriticalMultiplier: ld a, [wCriticalHit] and a @@ -3325,11 +3163,8 @@ BattleCommand_DamageCalc: ret - - INCLUDE "data/types/type_boost_items.asm" - BattleCommand_ConstantDamage: ; constantdamage @@ -3490,7 +3325,6 @@ BattleCommand_ConstantDamage: INCLUDE "data/moves/flail_reversal_power.asm" - INCLUDE "engine/battle/move_effects/counter.asm" INCLUDE "engine/battle/move_effects/encore.asm" @@ -3505,7 +3339,6 @@ INCLUDE "engine/battle/move_effects/lock_on.asm" INCLUDE "engine/battle/move_effects/sketch.asm" - BattleCommand_DefrostOpponent: ; defrostopponent ; Thaw the opponent if frozen, and @@ -3532,8 +3365,6 @@ BattleCommand_DefrostOpponent: ld [hl], a ret - - INCLUDE "engine/battle/move_effects/sleep_talk.asm" INCLUDE "engine/battle/move_effects/destiny_bond.asm" @@ -3544,7 +3375,6 @@ INCLUDE "engine/battle/move_effects/false_swipe.asm" INCLUDE "engine/battle/move_effects/heal_bell.asm" - FarPlayBattleAnimation: ; play animation de @@ -3566,8 +3396,6 @@ PlayFXAnimID: callfar PlayBattleAnim ret - - DoEnemyDamage: ld hl, wCurDamage ld a, [hli] @@ -3628,8 +3456,6 @@ DoEnemyDamage: .did_no_damage jp RefreshBattleHuds - - DoPlayerDamage: ld hl, wCurDamage ld a, [hli] @@ -3690,8 +3516,6 @@ DoPlayerDamage: .did_no_damage jp RefreshBattleHuds - - DoSubstituteDamage: ld hl, SubTookDamageText call StdBattleTextBox @@ -3749,10 +3573,7 @@ DoSubstituteDamage: .done jp ResetDamage - - UpdateMoveData: - ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVarAddr ld d, h @@ -3768,8 +3589,6 @@ UpdateMoveData: call GetMoveName jp CopyName1 - - BattleCommand_SleepTarget: ; sleeptarget @@ -3841,8 +3660,6 @@ BattleCommand_SleepTarget: pop hl jp StdBattleTextBox - - .CheckAIRandomFail: ; Enemy turn ld a, [hBattleTurn] @@ -3871,8 +3688,6 @@ BattleCommand_SleepTarget: xor a ret - - BattleCommand_PoisonTarget: ; poisontarget @@ -3908,8 +3723,6 @@ BattleCommand_PoisonTarget: farcall UseHeldStatusHealingItem ret - - BattleCommand_Poison: ; poison @@ -3998,15 +3811,11 @@ BattleCommand_Poison: pop hl jp StdBattleTextBox - - .apply_poison call AnimateCurrentMove call PoisonOpponent jp RefreshBattleHuds - - .check_toxic ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVarAddr @@ -4021,8 +3830,6 @@ BattleCommand_Poison: cp EFFECT_TOXIC ret - - CheckIfTargetIsPoisonType: ld de, wEnemyMonType1 ld a, [hBattleTurn] @@ -4038,32 +3845,24 @@ CheckIfTargetIsPoisonType: cp POISON ret - - PoisonOpponent: ld a, BATTLE_VARS_STATUS_OPP call GetBattleVarAddr set PSN, [hl] jp UpdateOpponentInParty - - BattleCommand_DrainTarget: ; draintarget call SapHealth ld hl, SuckedHealthText jp StdBattleTextBox - - BattleCommand_EatDream: ; eatdream call SapHealth ld hl, DreamEatenText jp StdBattleTextBox - - SapHealth: ; Divide damage by 2, store it in hDividend ld hl, wCurDamage @@ -4157,8 +3956,6 @@ SapHealth: call RefreshBattleHuds jp UpdateBattleMonInParty - - BattleCommand_BurnTarget: ; burntarget @@ -4200,8 +3997,6 @@ BattleCommand_BurnTarget: farcall UseHeldStatusHealingItem ret - - Defrost: ld a, [hl] and 1 << FRZ @@ -4227,8 +4022,6 @@ Defrost: ld hl, DefrostedOpponentText jp StdBattleTextBox - - BattleCommand_FreezeTarget: ; freezetarget @@ -4282,8 +4075,6 @@ BattleCommand_FreezeTarget: ld [hl], $1 ret - - BattleCommand_ParalyzeTarget: ; paralyzetarget @@ -4320,8 +4111,6 @@ BattleCommand_ParalyzeTarget: ld hl, UseHeldStatusHealingItem jp CallBattleCore - - BattleCommand_AttackUp: ; attackup ld b, ATTACK @@ -4400,8 +4189,6 @@ BattleCommand_StatUp: ret nz jp StatUpAnimation - - CheckIfStatCanBeRaised: ld a, b ld [wLoweredStat], a @@ -4481,14 +4268,11 @@ CheckIfStatCanBeRaised: ld [wFailedMessage], a ret - - .stats_already_max pop hl dec [hl] ; fallthrough - .cant_raise_stat ld a, $2 ld [wFailedMessage], a @@ -4496,15 +4280,11 @@ CheckIfStatCanBeRaised: ld [wAttackMissed], a ret - - .stat_raise_failed ld a, $1 ld [wFailedMessage], a ret - - StatUpAnimation: ld bc, wPlayerMinimized ld hl, DropPlayerSub @@ -4530,8 +4310,6 @@ StatUpAnimation: call WaitBGMap jp BattleCommand_MoveDelay - - BattleCommand_AttackDown: ; attackdown ld a, ATTACK @@ -4724,8 +4502,6 @@ BattleCommand_StatDown: ld [wAttackMissed], a ret - - CheckMist: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -4751,8 +4527,6 @@ CheckMist: bit SUBSTATUS_MIST, a ret - - BattleCommand_StatUpMessage: ld a, [wFailedMessage] and a @@ -4783,8 +4557,6 @@ BattleCommand_StatUpMessage: text_jump UnknownText_0x1c0ce0 db "@" - - BattleCommand_StatDownMessage: ld a, [wFailedMessage] and a @@ -4814,8 +4586,6 @@ BattleCommand_StatDownMessage: text_jump UnknownText_0x1c0d06 db "@" - - TryLowerStat: ; Lower stat c from stat struct hl (buffer de). @@ -4859,8 +4629,6 @@ TryLowerStat: and a ret - - BattleCommand_StatUpFailText: ; statupfailtext ld a, [wFailedMessage] @@ -4879,8 +4647,6 @@ BattleCommand_StatUpFailText: ld hl, WontRiseAnymoreText jp StdBattleTextBox - - BattleCommand_StatDownFailText: ; statdownfailtext ld a, [wFailedMessage] @@ -4902,8 +4668,6 @@ BattleCommand_StatDownFailText: ld hl, WontDropAnymoreText jp StdBattleTextBox - - GetStatName: ld hl, StatNames ld c, "@" @@ -4923,10 +4687,8 @@ GetStatName: INCLUDE "data/battle/stat_names.asm" - INCLUDE "data/battle/stat_multipliers.asm" - BattleCommand_AllStatsUp: ; allstatsup @@ -4955,14 +4717,11 @@ BattleCommand_AllStatsUp: call BattleCommand_SpecialDefenseUp jp BattleCommand_StatUpMessage - ResetMiss: xor a ld [wAttackMissed], a ret - - LowerStat: ld [wLoweredStat], a @@ -5034,8 +4793,6 @@ LowerStat: ld [wFailedMessage], a ret - - BattleCommand_TriStatusChance: ; tristatuschance @@ -5057,7 +4814,6 @@ BattleCommand_TriStatusChance: dw BattleCommand_FreezeTarget ; freeze dw BattleCommand_BurnTarget ; burn - BattleCommand_Curl: ; curl ld a, BATTLE_VARS_SUBSTATUS2 @@ -5065,8 +4821,6 @@ BattleCommand_Curl: set SUBSTATUS_CURLED, [hl] ret - - BattleCommand_RaiseSubNoAnim: ld hl, GetBattleMonBackpic ld a, [hBattleTurn] @@ -5079,8 +4833,6 @@ BattleCommand_RaiseSubNoAnim: call CallBattleCore jp WaitBGMap - - BattleCommand_LowerSubNoAnim: ld hl, DropPlayerSub ld a, [hBattleTurn] @@ -5093,8 +4845,6 @@ BattleCommand_LowerSubNoAnim: call CallBattleCore jp WaitBGMap - - CalcPlayerStats: ld hl, wPlayerAtkLevel ld de, wPlayerStats @@ -5116,8 +4866,6 @@ CalcPlayerStats: jp BattleCommand_SwitchTurn - - CalcEnemyStats: ld hl, wEnemyAtkLevel ld de, wEnemyStats @@ -5136,8 +4884,6 @@ CalcEnemyStats: jp BattleCommand_SwitchTurn - - CalcStats: .loop push af @@ -5207,11 +4953,8 @@ CalcStats: ret - - INCLUDE "engine/battle/move_effects/bide.asm" - BattleCommand_CheckRampage: ; checkrampage @@ -5249,8 +4992,6 @@ BattleCommand_CheckRampage: ld b, rampage_command jp SkipToBattleCommand - - BattleCommand_Rampage: ; rampage @@ -5278,11 +5019,8 @@ BattleCommand_Rampage: ld [wSomeoneIsRampaging], a ret - - INCLUDE "engine/battle/move_effects/teleport.asm" - SetBattleDraw: ld a, [wBattleResult] and BATTLERESULT_BITMASK @@ -5290,8 +5028,6 @@ SetBattleDraw: ld [wBattleResult], a ret - - BattleCommand_ForceSwitch: ; forceswitch @@ -5511,8 +5247,6 @@ BattleCommand_ForceSwitch: .do_text jp StdBattleTextBox - - CheckPlayerHasMonToSwitchTo: ld a, [wPartyCount] ld d, a @@ -5542,8 +5276,6 @@ CheckPlayerHasMonToSwitchTo: and a ret - - BattleCommand_EndLoop: ; endloop @@ -5678,8 +5410,6 @@ BattleCommand_EndLoop: ld [wBattleScriptBufferAddress], a ret - - BattleCommand_FakeOut: ld a, [wAttackMissed] and a @@ -5701,8 +5431,6 @@ BattleCommand_FakeOut: ld [wAttackMissed], a ret - - BattleCommand_FlinchTarget: call CheckSubstituteOpp ret nz @@ -5721,15 +5449,12 @@ BattleCommand_FlinchTarget: ; fallthrough - FlinchTarget: ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVarAddr set SUBSTATUS_FLINCHED, [hl] jp EndRechargeOpp - - CheckOpponentWentFirst: ; Returns a=0, z if user went first ; Returns a=1, nz if opponent went first @@ -5741,8 +5466,6 @@ CheckOpponentWentFirst: pop bc ret - - BattleCommand_HeldFlinch: ; kingsrock @@ -5771,8 +5494,6 @@ BattleCommand_HeldFlinch: set SUBSTATUS_FLINCHED, [hl] ret - - BattleCommand_OHKO: ; ohko @@ -5819,8 +5540,6 @@ BattleCommand_OHKO: ld [wAttackMissed], a ret - - BattleCommand_CheckCharge: ; checkcharge @@ -5834,8 +5553,6 @@ BattleCommand_CheckCharge: ld b, charge_command jp SkipToBattleCommand - - BattleCommand_Charge: ; charge @@ -5977,13 +5694,10 @@ BattleCommand_Charge: text_jump UnknownText_0x1c0d6c db "@" - BattleCommand3c: ; unused ret - - BattleCommand_TrapTarget: ; traptarget @@ -6040,12 +5754,10 @@ BattleCommand_TrapTarget: dbw CLAMP, ClampedByText ; 'was CLAMPED by' dbw WHIRLPOOL, WhirlpoolTrapText ; 'was trapped!' - INCLUDE "engine/battle/move_effects/mist.asm" INCLUDE "engine/battle/move_effects/focus_energy.asm" - BattleCommand_Recoil: ; recoil @@ -6110,8 +5822,6 @@ BattleCommand_Recoil: ld hl, RecoilText jp StdBattleTextBox - - BattleCommand_ConfuseTarget: ; confusetarget @@ -6132,7 +5842,6 @@ BattleCommand_ConfuseTarget: ret nz jr BattleCommand_FinishConfusingTarget - BattleCommand_Confuse: ; confuse @@ -6205,7 +5914,6 @@ BattleCommand_FinishConfusingTarget: ld hl, UseConfusionHealingItem jp CallBattleCore - BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -6217,8 +5925,6 @@ BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ret z jp PrintDidntAffect2 - - BattleCommand_Paralyze: ; paralyze @@ -6299,8 +6005,6 @@ BattleCommand_Paralyze: call AnimateFailedMove jp PrintDoesntAffect - - CheckMoveTypeMatchesTarget: ; Compare move type to opponent type. ; Return z if matching the opponent type, @@ -6336,11 +6040,8 @@ CheckMoveTypeMatchesTarget: pop hl ret - - INCLUDE "engine/battle/move_effects/substitute.asm" - BattleCommand_RechargeNextTurn: ; rechargenextturn ld a, BATTLE_VARS_SUBSTATUS4 @@ -6348,8 +6049,6 @@ BattleCommand_RechargeNextTurn: set SUBSTATUS_RECHARGE, [hl] ret - - EndRechargeOpp: push hl ld a, BATTLE_VARS_SUBSTATUS4_OPP @@ -6358,11 +6057,8 @@ EndRechargeOpp: pop hl ret - - INCLUDE "engine/battle/move_effects/rage.asm" - BattleCommand_DoubleFlyingDamage: ; doubleflyingdamage ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -6371,8 +6067,6 @@ BattleCommand_DoubleFlyingDamage: ret z jr DoubleDamage - - BattleCommand_DoubleUndergroundDamage: ; doubleundergrounddamage ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -6382,7 +6076,6 @@ BattleCommand_DoubleUndergroundDamage: ; fallthrough - DoubleDamage: ld hl, wCurDamage + 1 sla [hl] @@ -6396,8 +6089,6 @@ DoubleDamage: .quit ret - - INCLUDE "engine/battle/move_effects/mimic.asm" INCLUDE "engine/battle/move_effects/leech_seed.asm" @@ -6410,7 +6101,6 @@ INCLUDE "engine/battle/move_effects/pay_day.asm" INCLUDE "engine/battle/move_effects/conversion.asm" - BattleCommand_ResetStats: ; resetstats @@ -6444,8 +6134,6 @@ BattleCommand_ResetStats: jr nz, .next ret - - BattleCommand_Heal: ; heal @@ -6528,11 +6216,8 @@ BattleCommand_Heal: ld hl, HPIsFullText jp StdBattleTextBox - - INCLUDE "engine/battle/move_effects/transform.asm" - BattleSideCopy: ; Copy bc bytes from hl to de if it's the player's turn. ; Copy bc bytes from de to hl if it's the enemy's turn. @@ -6548,14 +6233,10 @@ BattleSideCopy: .copy jp CopyBytes - - BattleEffect_ButItFailed: call AnimateFailedMove jp PrintButItFailed - - ClearLastMove: ld a, BATTLE_VARS_LAST_COUNTER_MOVE call GetBattleVarAddr @@ -6568,8 +6249,6 @@ ClearLastMove: ld [hl], a ret - - ResetActorDisable: ld a, [hBattleTurn] and a @@ -6586,8 +6265,6 @@ ResetActorDisable: ld [wDisabledMove], a ret - - BattleCommand_Screen: ; screen @@ -6633,22 +6310,16 @@ BattleCommand_Screen: call AnimateFailedMove jp PrintButItFailed - - PrintDoesntAffect: ; 'it doesn't affect' ld hl, DoesntAffectText jp StdBattleTextBox - - PrintNothingHappened: ; 'but nothing happened!' ld hl, NothingHappenedText jp StdBattleTextBox - - TryPrintButItFailed: ld a, [wAlreadyFailed] and a @@ -6656,14 +6327,11 @@ TryPrintButItFailed: ; fallthrough - PrintButItFailed: ; 'but it failed!' ld hl, ButItFailedText jp StdBattleTextBox - - FailMove: call AnimateFailedMove ; fallthrough @@ -6673,45 +6341,34 @@ FailMimic: ld de, ItFailedText ; 'it failed!' jp FailText_CheckOpponentProtect - - PrintDidntAffect: ; 'it didn't affect' ld hl, DidntAffect1Text jp StdBattleTextBox - - PrintDidntAffect2: call AnimateFailedMove ld hl, DidntAffect1Text ; 'it didn't affect' ld de, DidntAffect2Text ; 'it didn't affect' jp FailText_CheckOpponentProtect - - PrintParalyze: ; 'paralyzed! maybe it can't attack!' ld hl, ParalyzedText jp StdBattleTextBox - - CheckSubstituteOpp: ld a, BATTLE_VARS_SUBSTATUS4_OPP call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret - - INCLUDE "engine/battle/move_effects/selfdestruct.asm" INCLUDE "engine/battle/move_effects/mirror_move.asm" INCLUDE "engine/battle/move_effects/metronome.asm" - CheckUserMove: ; Return z if the user has move a. ld b, a @@ -6736,8 +6393,6 @@ CheckUserMove: and a ret - - ResetTurn: ld hl, wPlayerCharging ld a, [hBattleTurn] @@ -6752,11 +6407,8 @@ ResetTurn: call DoMove jp EndMoveEffect - - INCLUDE "engine/battle/move_effects/thief.asm" - BattleCommand_ArenaTrap: ; arenatrap @@ -6783,11 +6435,8 @@ BattleCommand_ArenaTrap: call AnimateFailedMove jp PrintButItFailed - - INCLUDE "engine/battle/move_effects/nightmare.asm" - BattleCommand_Defrost: ; defrost @@ -6819,8 +6468,6 @@ BattleCommand_Defrost: ld hl, WasDefrostedText jp StdBattleTextBox - - INCLUDE "engine/battle/move_effects/curse.asm" INCLUDE "engine/battle/move_effects/protect.asm" @@ -6837,13 +6484,10 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm" INCLUDE "engine/battle/move_effects/rollout.asm" - BattleCommand5d: ; unused ret - - INCLUDE "engine/battle/move_effects/fury_cutter.asm" INCLUDE "engine/battle/move_effects/attract.asm" @@ -6856,7 +6500,6 @@ INCLUDE "engine/battle/move_effects/frustration.asm" INCLUDE "engine/battle/move_effects/safeguard.asm" - SafeCheckSafeguard: push hl ld hl, wEnemyScreens @@ -6870,8 +6513,6 @@ SafeCheckSafeguard: pop hl ret - - BattleCommand_CheckSafeguard: ; checksafeguard ld hl, wEnemyScreens @@ -6889,8 +6530,6 @@ BattleCommand_CheckSafeguard: call StdBattleTextBox jp EndMoveEffect - - INCLUDE "engine/battle/move_effects/magnitude.asm" INCLUDE "engine/battle/move_effects/baton_pass.asm" @@ -6899,19 +6538,16 @@ INCLUDE "engine/battle/move_effects/pursuit.asm" INCLUDE "engine/battle/move_effects/rapid_spin.asm" - BattleCommand_HealMorn: ; healmorn ld b, MORN_F jr BattleCommand_TimeBasedHealContinue - BattleCommand_HealDay: ; healday ld b, DAY_F jr BattleCommand_TimeBasedHealContinue - BattleCommand_HealNite: ; healnite ld b, NITE_F @@ -6999,7 +6635,6 @@ BattleCommand_TimeBasedHealContinue: dw GetHalfMaxHP dw GetMaxHP - INCLUDE "engine/battle/move_effects/hidden_power.asm" INCLUDE "engine/battle/move_effects/rain_dance.asm" @@ -7012,7 +6647,6 @@ INCLUDE "engine/battle/move_effects/psych_up.asm" INCLUDE "engine/battle/move_effects/mirror_coat.asm" - BattleCommand_DoubleMinimizeDamage: ; doubleminimizedamage @@ -7035,8 +6669,6 @@ BattleCommand_DoubleMinimizeDamage: ld [hl], a ret - - BattleCommand_SkipSunCharge: ; mimicsuncharge ld a, [wBattleWeather] @@ -7045,13 +6677,10 @@ BattleCommand_SkipSunCharge: ld b, charge_command jp SkipToBattleCommand - - INCLUDE "engine/battle/move_effects/future_sight.asm" INCLUDE "engine/battle/move_effects/thunder.asm" - CheckHiddenOpponent: ; BUG: This routine should account for Lock-On and Mind Reader. ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -7059,8 +6688,6 @@ CheckHiddenOpponent: and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret - - GetUserItem: ; Return the effect of the user's item in bc, and its id at hl. ld hl, wBattleMonItem @@ -7072,8 +6699,6 @@ GetUserItem: ld b, [hl] jp GetItemHeldEffect - - GetOpponentItem: ; Return the effect of the opponent's item in bc, and its id at hl. ld hl, wEnemyMonItem @@ -7085,8 +6710,6 @@ GetOpponentItem: ld b, [hl] jp GetItemHeldEffect - - GetItemHeldEffect: ; Return the effect of item b in bc. ld a, b @@ -7107,8 +6730,6 @@ GetItemHeldEffect: pop hl ret - - AnimateCurrentMoveEitherSide: push hl push de @@ -7125,8 +6746,6 @@ AnimateCurrentMoveEitherSide: pop hl ret - - AnimateCurrentMove: push hl push de @@ -7143,8 +6762,6 @@ AnimateCurrentMove: pop hl ret - - PlayDamageAnim: xor a ld [wFXAnimID + 1], a @@ -7167,8 +6784,6 @@ PlayDamageAnim: jp PlayUserBattleAnim - - LoadMoveAnim: xor a ld [wNumHits], a @@ -7181,13 +6796,11 @@ LoadMoveAnim: ; fallthrough - LoadAnim: ld [wFXAnimID], a ; fallthrough - PlayUserBattleAnim: push hl push de @@ -7198,8 +6811,6 @@ PlayUserBattleAnim: pop hl ret - - PlayOpponentBattleAnim: ld a, e ld [wFXAnimID], a @@ -7221,30 +6832,22 @@ PlayOpponentBattleAnim: pop hl ret - - CallBattleCore: ld a, BANK("Battle Core") rst FarCall ret - - AnimateFailedMove: call BattleCommand_LowerSub call BattleCommand_MoveDelay jp BattleCommand_RaiseSub - - BattleCommand_MoveDelay: ; movedelay ; Wait 40 frames. ld c, 40 jp DelayFrames - - BattleCommand_ClearText: ; cleartext @@ -7255,7 +6858,6 @@ BattleCommand_ClearText: .text db "@" - SkipToBattleCommand: ; Skip over commands until reaching command b. ld a, [wBattleScriptBufferAddress + 1] @@ -7273,8 +6875,6 @@ SkipToBattleCommand: ld [wBattleScriptBufferAddress], a ret - - GetMoveAttr: ; Assuming hl = Moves + x, return attribute x of move a. push bc @@ -7284,8 +6884,6 @@ GetMoveAttr: pop bc ret - - GetMoveData: ; Copy move struct a to de. ld hl, Moves @@ -7294,32 +6892,22 @@ GetMoveData: ld a, BANK(Moves) jp FarCopyBytes - - GetMoveByte: ld a, BANK(Moves) jp GetFarByte - - DisappearUser: farcall _DisappearUser ret - - AppearUserLowerSub: farcall _AppearUserLowerSub ret - - AppearUserRaiseSub: farcall _AppearUserRaiseSub ret - - _CheckBattleScene: ; Checks the options. Returns carry if battle animations are disabled. push hl @@ -7330,4 +6918,3 @@ _CheckBattleScene: pop de pop hl ret - diff --git a/engine/battle/hidden_power.asm b/engine/battle/hidden_power.asm index 5f3791e18..537fe4354 100644 --- a/engine/battle/hidden_power.asm +++ b/engine/battle/hidden_power.asm @@ -8,7 +8,6 @@ HiddenPowerDamage: ld hl, wEnemyMonDVs .got_dvs - ; Power: ; Take the top bit from each stat @@ -62,7 +61,6 @@ HiddenPowerDamage: ld d, a - ; Type: ; Def & 3 diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm index 1b6cb6783..48062f643 100644 --- a/engine/battle/misc.asm +++ b/engine/battle/misc.asm @@ -49,9 +49,7 @@ GetPlayerBackpicCoords: lb bc, 6, 6 ret - DoWeatherModifiers: - ld de, WeatherTypeModifiers ld a, [wBattleWeather] ld b, a @@ -76,7 +74,6 @@ DoWeatherModifiers: inc de jr .CheckWeatherType - .done_weather_types ld de, WeatherMoveModifiers @@ -147,7 +144,6 @@ DoWeatherModifiers: INCLUDE "data/battle/weather_modifiers.asm" - DoBadgeTypeBoosts: ld a, [wLinkMode] and a diff --git a/engine/battle/move_effects/attract.asm b/engine/battle/move_effects/attract.asm index 45417936f..bb7b4fce4 100644 --- a/engine/battle/move_effects/attract.asm +++ b/engine/battle/move_effects/attract.asm @@ -22,7 +22,6 @@ BattleCommand_Attract: .failed jp FailMove - CheckOppositeGender: ld a, MON_SPECIES call BattlePartyAttr diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm index 2937a8306..5d9f19838 100644 --- a/engine/battle/move_effects/baton_pass.asm +++ b/engine/battle/move_effects/baton_pass.asm @@ -5,7 +5,6 @@ BattleCommand_BatonPass: and a jp nz, .Enemy - ; Need something to switch to call CheckAnyOtherAlivePartyMons jp z, FailedBatonPass @@ -45,9 +44,7 @@ BattleCommand_BatonPass: call ResetBatonPassStatus ret - .Enemy: - ; Wildmons don't have anything to switch to ld a, [wBattleMode] dec a ; WILDMON @@ -81,8 +78,6 @@ BattleCommand_BatonPass: jr ResetBatonPassStatus - - BatonPass_LinkPlayerSwitch: ld a, [wLinkMode] and a @@ -100,8 +95,6 @@ BatonPass_LinkPlayerSwitch: ld [wBattlePlayerAction], a ret - - BatonPass_LinkEnemySwitch: ld a, [wLinkMode] and a @@ -127,14 +120,10 @@ BatonPass_LinkEnemySwitch: .switch jp CloseWindow - - FailedBatonPass: call AnimateFailedMove jp PrintButItFailed - - ResetBatonPassStatus: ; Reset status changes that aren't passed by Baton Pass. @@ -174,8 +163,6 @@ ResetBatonPassStatus: ld [wEnemyWrapCount], a ret - - CheckAnyOtherAlivePartyMons: ld hl, wPartyMon1HP ld a, [wPartyCount] @@ -184,8 +171,6 @@ CheckAnyOtherAlivePartyMons: ld e, a jr CheckAnyOtherAliveMons - - CheckAnyOtherAliveEnemyMons: ld hl, wOTPartyMon1HP ld a, [wOTPartyCount] @@ -230,4 +215,3 @@ CheckAnyOtherAliveMons: ld a, b and a ret - diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm index 40a375e0d..673fc46c6 100644 --- a/engine/battle/move_effects/beat_up.asm +++ b/engine/battle/move_effects/beat_up.asm @@ -193,14 +193,10 @@ BattleCommand_BeatUp: ld d, a ret - - .beatup_fail ld b, buildopponentrage_command jp SkipToBattleCommand - - BattleCommand_BeatUpFailText: ; beatupfailtext @@ -210,8 +206,6 @@ BattleCommand_BeatUpFailText: jp PrintButItFailed - - GetBeatupMonLocation: push bc ld c, a diff --git a/engine/battle/move_effects/belly_drum.asm b/engine/battle/move_effects/belly_drum.asm index aec3a1d68..27ef1a542 100644 --- a/engine/battle/move_effects/belly_drum.asm +++ b/engine/battle/move_effects/belly_drum.asm @@ -32,4 +32,3 @@ BattleCommand_BellyDrum: .failed call AnimateFailedMove jp PrintButItFailed - diff --git a/engine/battle/move_effects/bide.asm b/engine/battle/move_effects/bide.asm index b28773df9..871e0e7a8 100644 --- a/engine/battle/move_effects/bide.asm +++ b/engine/battle/move_effects/bide.asm @@ -69,8 +69,6 @@ BattleCommand_StoreEnergy: call StdBattleTextBox jp EndMoveEffect - - BattleCommand_UnleashEnergy: ; unleashenergy @@ -100,4 +98,3 @@ BattleCommand_UnleashEnergy: ld [wKickCounter], a call AnimateCurrentMove jp EndMoveEffect - diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm index bc2c746df..f9307056c 100644 --- a/engine/battle/move_effects/conversion.asm +++ b/engine/battle/move_effects/conversion.asm @@ -94,4 +94,3 @@ BattleCommand_Conversion: call AnimateCurrentMove ld hl, TransformedTypeText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm index b1d0e6282..14a7e257a 100644 --- a/engine/battle/move_effects/conversion2.asm +++ b/engine/battle/move_effects/conversion2.asm @@ -62,4 +62,3 @@ BattleCommand_Conversion2: .failed jp FailMove - diff --git a/engine/battle/move_effects/counter.asm b/engine/battle/move_effects/counter.asm index 9d10d1865..f92e1b3ac 100644 --- a/engine/battle/move_effects/counter.asm +++ b/engine/battle/move_effects/counter.asm @@ -56,4 +56,3 @@ BattleCommand_Counter: xor a ld [wAttackMissed], a ret - diff --git a/engine/battle/move_effects/curse.asm b/engine/battle/move_effects/curse.asm index e0fc0144c..4861e9a37 100644 --- a/engine/battle/move_effects/curse.asm +++ b/engine/battle/move_effects/curse.asm @@ -21,7 +21,6 @@ BattleCommand_Curse: cp GHOST jr z, .ghost - ; If no stats can be increased, don't. ; Attack @@ -54,7 +53,6 @@ BattleCommand_Curse: call BattleCommand_DefenseUp jp BattleCommand_StatUpMessage - .ghost ; Cut HP in half and put a curse on the opponent. @@ -84,7 +82,6 @@ BattleCommand_Curse: call AnimateFailedMove jp PrintButItFailed - .cantraise ; Can't raise either stat. diff --git a/engine/battle/move_effects/destiny_bond.asm b/engine/battle/move_effects/destiny_bond.asm index 427c8b08a..55809d98a 100644 --- a/engine/battle/move_effects/destiny_bond.asm +++ b/engine/battle/move_effects/destiny_bond.asm @@ -7,4 +7,3 @@ BattleCommand_DestinyBond: call AnimateCurrentMove ld hl, DestinyBondEffectText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/disable.asm b/engine/battle/move_effects/disable.asm index b1055b200..44017e30d 100644 --- a/engine/battle/move_effects/disable.asm +++ b/engine/battle/move_effects/disable.asm @@ -70,4 +70,3 @@ BattleCommand_Disable: .failed jp FailMove - diff --git a/engine/battle/move_effects/encore.asm b/engine/battle/move_effects/encore.asm index e65925f52..f436fd970 100644 --- a/engine/battle/move_effects/encore.asm +++ b/engine/battle/move_effects/encore.asm @@ -118,4 +118,3 @@ BattleCommand_Encore: .failed jp PrintDidntAffect2 - diff --git a/engine/battle/move_effects/false_swipe.asm b/engine/battle/move_effects/false_swipe.asm index c61aa534a..4f4eb329c 100644 --- a/engine/battle/move_effects/false_swipe.asm +++ b/engine/battle/move_effects/false_swipe.asm @@ -46,4 +46,3 @@ BattleCommand_FalseSwipe: .done and a ret - diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm index 8fa6b19ff..ffdc7b136 100644 --- a/engine/battle/move_effects/focus_energy.asm +++ b/engine/battle/move_effects/focus_energy.asm @@ -13,4 +13,3 @@ BattleCommand_FocusEnergy: .already_pumped call AnimateFailedMove jp PrintButItFailed - diff --git a/engine/battle/move_effects/frustration.asm b/engine/battle/move_effects/frustration.asm index 5e45636be..3d395b510 100644 --- a/engine/battle/move_effects/frustration.asm +++ b/engine/battle/move_effects/frustration.asm @@ -25,4 +25,3 @@ BattleCommand_FrustrationPower: ld d, a pop bc ret - diff --git a/engine/battle/move_effects/fury_cutter.asm b/engine/battle/move_effects/fury_cutter.asm index b34264d62..6aa6b7838 100644 --- a/engine/battle/move_effects/fury_cutter.asm +++ b/engine/battle/move_effects/fury_cutter.asm @@ -38,10 +38,7 @@ BattleCommand_FuryCutter: ld [hl], a ret - - ResetFuryCutterCount: - push hl ld hl, wPlayerFuryCutterCount @@ -56,4 +53,3 @@ ResetFuryCutterCount: pop hl ret - diff --git a/engine/battle/move_effects/future_sight.asm b/engine/battle/move_effects/future_sight.asm index c1b5c0e72..c28841b35 100644 --- a/engine/battle/move_effects/future_sight.asm +++ b/engine/battle/move_effects/future_sight.asm @@ -25,7 +25,6 @@ BattleCommand_CheckFutureSight: ld b, futuresight_command jp SkipToBattleCommand - BattleCommand_FutureSight: ; futuresight @@ -80,4 +79,3 @@ BattleCommand_FutureSight: call AnimateFailedMove call PrintButItFailed jp EndMoveEffect - diff --git a/engine/battle/move_effects/heal_bell.asm b/engine/battle/move_effects/heal_bell.asm index 060ac3423..2570a53ba 100644 --- a/engine/battle/move_effects/heal_bell.asm +++ b/engine/battle/move_effects/heal_bell.asm @@ -32,4 +32,3 @@ BattleCommand_HealBell: and a jp z, CalcPlayerStats jp CalcEnemyStats - diff --git a/engine/battle/move_effects/hidden_power.asm b/engine/battle/move_effects/hidden_power.asm index 19d7e0b32..3b40a6c31 100644 --- a/engine/battle/move_effects/hidden_power.asm +++ b/engine/battle/move_effects/hidden_power.asm @@ -6,4 +6,3 @@ BattleCommand_HiddenPower: ret nz farcall HiddenPowerDamage ret - diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm index 44019a6ad..5602e7f62 100644 --- a/engine/battle/move_effects/leech_seed.asm +++ b/engine/battle/move_effects/leech_seed.asm @@ -38,4 +38,3 @@ BattleCommand_LeechSeed: call AnimateFailedMove ld hl, EvadedText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/lock_on.asm b/engine/battle/move_effects/lock_on.asm index 7b6503575..7dc4a013d 100644 --- a/engine/battle/move_effects/lock_on.asm +++ b/engine/battle/move_effects/lock_on.asm @@ -19,4 +19,3 @@ BattleCommand_LockOn: .fail call AnimateFailedMove jp PrintDidntAffect - diff --git a/engine/battle/move_effects/metronome.asm b/engine/battle/move_effects/metronome.asm index b5632d005..b8a6b586f 100644 --- a/engine/battle/move_effects/metronome.asm +++ b/engine/battle/move_effects/metronome.asm @@ -34,12 +34,10 @@ BattleCommand_Metronome: call CheckUserMove jr z, .GetMove - ld a, BATTLE_VARS_MOVE call GetBattleVarAddr ld [hl], b call UpdateMoveData jp ResetTurn - INCLUDE "data/battle/metronome_exception_moves.asm" diff --git a/engine/battle/move_effects/mimic.asm b/engine/battle/move_effects/mimic.asm index 2f91d6a1d..b1c6608fa 100644 --- a/engine/battle/move_effects/mimic.asm +++ b/engine/battle/move_effects/mimic.asm @@ -48,4 +48,3 @@ BattleCommand_Mimic: .fail jp FailMimic - diff --git a/engine/battle/move_effects/mirror_coat.asm b/engine/battle/move_effects/mirror_coat.asm index f8b8ca114..8743c389d 100644 --- a/engine/battle/move_effects/mirror_coat.asm +++ b/engine/battle/move_effects/mirror_coat.asm @@ -57,4 +57,3 @@ BattleCommand_MirrorCoat: xor a ld [wAttackMissed], a ret - diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm index 52e4e59f4..199a30045 100644 --- a/engine/battle/move_effects/mist.asm +++ b/engine/battle/move_effects/mist.asm @@ -13,4 +13,3 @@ BattleCommand_Mist: .already_mist call AnimateFailedMove jp PrintButItFailed - diff --git a/engine/battle/move_effects/pain_split.asm b/engine/battle/move_effects/pain_split.asm index a4dbd3d44..4e4380b23 100644 --- a/engine/battle/move_effects/pain_split.asm +++ b/engine/battle/move_effects/pain_split.asm @@ -89,7 +89,5 @@ BattleCommand_PainSplit: ld [wBuffer6], a ret - .ButItFailed: jp PrintDidntAffect2 - diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm index 53705d434..ba1dce884 100644 --- a/engine/battle/move_effects/pay_day.asm +++ b/engine/battle/move_effects/pay_day.asm @@ -24,4 +24,3 @@ BattleCommand_PayDay: .done ld hl, CoinsScatteredText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/perish_song.asm b/engine/battle/move_effects/perish_song.asm index 221ecfb46..4df52cc1c 100644 --- a/engine/battle/move_effects/perish_song.asm +++ b/engine/battle/move_effects/perish_song.asm @@ -1,7 +1,6 @@ BattleCommand_PerishSong: ; perishsong - ld hl, wPlayerSubStatus1 ld de, wEnemySubStatus1 bit SUBSTATUS_PERISH, [hl] diff --git a/engine/battle/move_effects/protect.asm b/engine/battle/move_effects/protect.asm index 768e51cbb..9025d2f4b 100644 --- a/engine/battle/move_effects/protect.asm +++ b/engine/battle/move_effects/protect.asm @@ -12,9 +12,7 @@ BattleCommand_Protect: ld hl, ProtectedItselfText jp StdBattleTextBox - ProtectChance: - ld de, wPlayerProtectCount ld a, [hBattleTurn] and a @@ -68,7 +66,6 @@ ProtectChance: and a ret - .failed xor a ld [de], a diff --git a/engine/battle/move_effects/psych_up.asm b/engine/battle/move_effects/psych_up.asm index 743e93c86..02fdef5d2 100644 --- a/engine/battle/move_effects/psych_up.asm +++ b/engine/battle/move_effects/psych_up.asm @@ -47,4 +47,3 @@ BattleCommand_PsychUp: call AnimateCurrentMove ld hl, CopiedStatsText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/pursuit.asm b/engine/battle/move_effects/pursuit.asm index 640957516..18c358144 100644 --- a/engine/battle/move_effects/pursuit.asm +++ b/engine/battle/move_effects/pursuit.asm @@ -22,4 +22,3 @@ BattleCommand_Pursuit: ld [hli], a ld [hl], a ret - diff --git a/engine/battle/move_effects/rage.asm b/engine/battle/move_effects/rage.asm index 1f40cc1fb..df206a6bf 100644 --- a/engine/battle/move_effects/rage.asm +++ b/engine/battle/move_effects/rage.asm @@ -4,4 +4,3 @@ BattleCommand_Rage: call GetBattleVarAddr set SUBSTATUS_RAGE, [hl] ret - diff --git a/engine/battle/move_effects/rain_dance.asm b/engine/battle/move_effects/rain_dance.asm index fa8881c3c..e9ef5d123 100644 --- a/engine/battle/move_effects/rain_dance.asm +++ b/engine/battle/move_effects/rain_dance.asm @@ -7,4 +7,3 @@ BattleCommand_StartRain: call AnimateCurrentMove ld hl, DownpourText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/rapid_spin.asm b/engine/battle/move_effects/rapid_spin.asm index 089be7667..0dc8b7de2 100644 --- a/engine/battle/move_effects/rapid_spin.asm +++ b/engine/battle/move_effects/rapid_spin.asm @@ -34,4 +34,3 @@ BattleCommand_ClearHazards: ld [de], a ld hl, ReleasedByText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/return.asm b/engine/battle/move_effects/return.asm index ee83843b3..d3071d23a 100644 --- a/engine/battle/move_effects/return.asm +++ b/engine/battle/move_effects/return.asm @@ -23,4 +23,3 @@ BattleCommand_HappinessPower: ld d, a pop bc ret - diff --git a/engine/battle/move_effects/rollout.asm b/engine/battle/move_effects/rollout.asm index da890f48f..de4bfcaa6 100644 --- a/engine/battle/move_effects/rollout.asm +++ b/engine/battle/move_effects/rollout.asm @@ -1,6 +1,5 @@ MAX_ROLLOUT_COUNT EQU 5 - BattleCommand_CheckCurl: ; checkcurl @@ -23,7 +22,6 @@ BattleCommand_CheckCurl: ld [de], a ret - BattleCommand_RolloutPower: ; rolloutpower diff --git a/engine/battle/move_effects/safeguard.asm b/engine/battle/move_effects/safeguard.asm index e4e2e0951..a926bdccc 100644 --- a/engine/battle/move_effects/safeguard.asm +++ b/engine/battle/move_effects/safeguard.asm @@ -21,4 +21,3 @@ BattleCommand_Safeguard: .failed call AnimateFailedMove jp PrintButItFailed - diff --git a/engine/battle/move_effects/selfdestruct.asm b/engine/battle/move_effects/selfdestruct.asm index 3c7b05ef9..d6eeac484 100644 --- a/engine/battle/move_effects/selfdestruct.asm +++ b/engine/battle/move_effects/selfdestruct.asm @@ -27,4 +27,3 @@ BattleCommand_Selfdestruct: farcall DrawEnemyHUD call WaitBGMap jp RefreshBattleHuds - diff --git a/engine/battle/move_effects/sketch.asm b/engine/battle/move_effects/sketch.asm index 1f2e67dd4..4c15dbe02 100644 --- a/engine/battle/move_effects/sketch.asm +++ b/engine/battle/move_effects/sketch.asm @@ -115,4 +115,3 @@ BattleCommand_Sketch: .fail call AnimateFailedMove jp PrintDidntAffect - diff --git a/engine/battle/move_effects/sleep_talk.asm b/engine/battle/move_effects/sleep_talk.asm index ce7a27ed5..ae2d252b7 100644 --- a/engine/battle/move_effects/sleep_talk.asm +++ b/engine/battle/move_effects/sleep_talk.asm @@ -141,4 +141,3 @@ BattleCommand_SleepTalk: ret z cp EFFECT_BIDE ret - diff --git a/engine/battle/move_effects/snore.asm b/engine/battle/move_effects/snore.asm index 4544b7fbd..e2432c59f 100644 --- a/engine/battle/move_effects/snore.asm +++ b/engine/battle/move_effects/snore.asm @@ -9,4 +9,3 @@ BattleCommand_Snore: ld [wAttackMissed], a call FailMove jp EndMoveEffect - diff --git a/engine/battle/move_effects/spite.asm b/engine/battle/move_effects/spite.asm index 7c9499074..8aba187a4 100644 --- a/engine/battle/move_effects/spite.asm +++ b/engine/battle/move_effects/spite.asm @@ -84,4 +84,3 @@ BattleCommand_Spite: .failed jp PrintDidntAffect2 - diff --git a/engine/battle/move_effects/splash.asm b/engine/battle/move_effects/splash.asm index ed9eeb4ca..493ea8ca6 100644 --- a/engine/battle/move_effects/splash.asm +++ b/engine/battle/move_effects/splash.asm @@ -2,4 +2,3 @@ BattleCommand_Splash: call AnimateCurrentMove farcall StubbedTrainerRankings_Splash jp PrintNothingHappened - diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index f439afd78..8f14bc315 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -86,4 +86,3 @@ BattleCommand_Substitute: ld hl, TooWeakSubText .jp_stdbattletextbox jp StdBattleTextBox - diff --git a/engine/battle/move_effects/sunny_day.asm b/engine/battle/move_effects/sunny_day.asm index ad2298401..f5825930f 100644 --- a/engine/battle/move_effects/sunny_day.asm +++ b/engine/battle/move_effects/sunny_day.asm @@ -7,4 +7,3 @@ BattleCommand_StartSun: call AnimateCurrentMove ld hl, SunGotBrightText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/teleport.asm b/engine/battle/move_effects/teleport.asm index b9c7f9fb2..1c67ef112 100644 --- a/engine/battle/move_effects/teleport.asm +++ b/engine/battle/move_effects/teleport.asm @@ -87,4 +87,3 @@ BattleCommand_Teleport: ld hl, FledFromBattleText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/thief.asm b/engine/battle/move_effects/thief.asm index d9d2f47fd..64de1a4fe 100644 --- a/engine/battle/move_effects/thief.asm +++ b/engine/battle/move_effects/thief.asm @@ -50,7 +50,6 @@ BattleCommand_Thief: ld [de], a jr .stole - .enemy ; The enemy can't already have an item. @@ -91,13 +90,11 @@ BattleCommand_Thief: ld [hl], a ld [de], a - .stole call GetItemName ld hl, StoleText jp StdBattleTextBox - .playeritem ld a, 1 call BattlePartyAttr diff --git a/engine/battle/move_effects/thunder.asm b/engine/battle/move_effects/thunder.asm index 1a87176bd..b2a643787 100644 --- a/engine/battle/move_effects/thunder.asm +++ b/engine/battle/move_effects/thunder.asm @@ -16,4 +16,3 @@ BattleCommand_ThunderAccuracy: ; Redundant with CheckHit guranteeing hit ld [hl], 100 percent ret - diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm index fe85658e6..ef8071290 100644 --- a/engine/battle/move_effects/transform.asm +++ b/engine/battle/move_effects/transform.asm @@ -137,4 +137,3 @@ BattleCommand_Transform: call nz, LoadAnim ld hl, TransformedText jp StdBattleTextBox - diff --git a/engine/battle/move_effects/triple_kick.asm b/engine/battle/move_effects/triple_kick.asm index 4fb939d7c..e41044c9d 100644 --- a/engine/battle/move_effects/triple_kick.asm +++ b/engine/battle/move_effects/triple_kick.asm @@ -26,12 +26,9 @@ BattleCommand_TripleKick: ld [hl], a ret - - BattleCommand_KickCounter: ; kickcounter ld hl, wKickCounter inc [hl] ret - diff --git a/engine/battle/read_trainer_attributes.asm b/engine/battle/read_trainer_attributes.asm index 12554ebaf..6db8f4204 100644 --- a/engine/battle/read_trainer_attributes.asm +++ b/engine/battle/read_trainer_attributes.asm @@ -62,3 +62,5 @@ GetTrainerAttributes: ld a, [hl] ld [wEnemyTrainerBaseReward], a ret + +INCLUDE "data/trainers/attributes.asm" diff --git a/engine/battle/read_trainer_dvs.asm b/engine/battle/read_trainer_dvs.asm index 67ea0fe3c..d35c9ea61 100644 --- a/engine/battle/read_trainer_dvs.asm +++ b/engine/battle/read_trainer_dvs.asm @@ -17,3 +17,5 @@ GetTrainerDVs: pop hl ret + +INCLUDE "data/trainers/dvs.asm" diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index 3b1fe3bca..0a537b64e 100644 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -321,7 +321,6 @@ ComputeTrainerReward: ld [hl], a ret - Battle_GetTrainerName:: ld a, [wInBattleTowerBattle] bit 0, a @@ -388,3 +387,5 @@ Function39990: ld bc, NAME_LENGTH pop de ret + +INCLUDE "data/trainers/parties.asm" diff --git a/engine/battle/used_move_text.asm b/engine/battle/used_move_text.asm index 2bb6b7845..9307a1a1e 100644 --- a/engine/battle/used_move_text.asm +++ b/engine/battle/used_move_text.asm @@ -131,7 +131,6 @@ EndUsedMove5Text: text_jump _EndUsedMove5Text db "@" - GetMoveGrammar: ; store move grammar type in wd265 @@ -169,7 +168,6 @@ GetMoveGrammar: INCLUDE "data/moves/grammar.asm" - UpdateUsedMoves: ; append move a to wPlayerUsedMoves unless it has already been used |