diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-02-03 18:21:53 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-02-03 19:42:56 -0500 |
commit | 32ed487a476e01759d3d9dbc818d8566ae2c9cb7 (patch) | |
tree | 669e90b56d36f17efff5f673235193f5298c0ceb /engine/battle/move_effects | |
parent | 6ff2cb20e67db2054486fc5dc48eb9263298d4ad (diff) | |
parent | b35eb72290b964b98844afbe741bb7ede34b9ef3 (diff) |
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts:
# audio/engine.asm
# constants/gfx_constants.asm
# constants/map_data_constants.asm
# constants/pokemon_data_constants.asm
# constants/sprite_constants.asm
# constants/wram_constants.asm
# data/maps/data.asm
# engine/battle/ai/scoring.asm
# engine/battle/core.asm
# engine/battle/effect_commands.asm
# engine/battle/misc.asm
# engine/battle_anims/getpokeballwobble.asm
# engine/breeding.asm
# engine/buy_sell_toss.asm
# engine/decorations.asm
# engine/events/battle_tower/battle_tower.asm
# engine/events/battle_tower/rules.asm
# engine/events/buena.asm
# engine/events/bug_contest/contest_2.asm
# engine/events/daycare.asm
# engine/events/dratini.asm
# engine/events/halloffame.asm
# engine/events/happiness_egg.asm
# engine/events/kurt.asm
# engine/events/lucky_number.asm
# engine/events/magnet_train.asm
# engine/events/overworld.asm
# engine/events/pokerus/pokerus.asm
# engine/events/print_unown.asm
# engine/events/print_unown_2.asm
# engine/events/unown_walls.asm
# engine/item_effects.asm
# engine/link.asm
# engine/mon_menu.asm
# engine/player_object.asm
# engine/routines/playslowcry.asm
# engine/scripting.asm
# engine/search.asm
# engine/search2.asm
# engine/specials.asm
# engine/start_menu.asm
# engine/timeset.asm
# home/battle_vars.asm
# home/map.asm
# maps/GoldenrodUndergroundSwitchRoomEntrances.asm
# maps/IlexForest.asm
# maps/KrissHouse2F.asm
# maps/Route39Barn.asm
# mobile/mobile_12_2.asm
# mobile/mobile_40.asm
# mobile/mobile_5f.asm
# wram.asm
Diffstat (limited to 'engine/battle/move_effects')
47 files changed, 249 insertions, 249 deletions
diff --git a/engine/battle/move_effects/attract.asm b/engine/battle/move_effects/attract.asm index 44cb7bec4..026176694 100755 --- a/engine/battle/move_effects/attract.asm +++ b/engine/battle/move_effects/attract.asm @@ -1,6 +1,6 @@ BattleCommand_Attract: ; 377ce ; attract - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed call CheckOppositeGender @@ -28,12 +28,12 @@ CheckOppositeGender: ; 377f5 ld a, MON_SPECIES call BattlePartyAttr ld a, [hl] - ld [CurPartySpecies], a + ld [wCurPartySpecies], a - ld a, [CurBattleMon] - ld [CurPartyMon], a + ld a, [wCurBattleMon] + ld [wCurPartyMon], a xor a - ld [MonType], a + ld [wMonType], a farcall GetGender jr c, .genderless_samegender @@ -44,20 +44,20 @@ CheckOppositeGender: ; 377f5 .got_gender push bc - ld a, [TempEnemyMonSpecies] - ld [CurPartySpecies], a - ld hl, EnemyMonDVs - ld a, [EnemySubStatus5] + ld a, [wTempEnemyMonSpecies] + ld [wCurPartySpecies], a + ld hl, wEnemyMonDVs + ld a, [wEnemySubStatus5] bit SUBSTATUS_TRANSFORMED, a jr z, .not_transformed ld hl, wEnemyBackupDVs .not_transformed ld a, [hli] - ld [TempMonDVs], a + ld [wTempMonDVs], a ld a, [hl] - ld [TempMonDVs + 1], a + ld [wTempMonDVs + 1], a ld a, 3 - ld [MonType], a + ld [wMonType], a farcall GetGender pop bc jr c, .genderless_samegender diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm index 0561b6db9..369565877 100644 --- a/engine/battle/move_effects/baton_pass.asm +++ b/engine/battle/move_effects/baton_pass.asm @@ -90,7 +90,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67 ret z ld a, 1 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a call LoadStandardMenuHeader ld hl, LinkBattleSendReceiveAction @@ -98,7 +98,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67 call CloseWindow xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ret ; 37a82 @@ -113,7 +113,7 @@ BatonPass_LinkEnemySwitch: ; 37a82 ld hl, LinkBattleSendReceiveAction call CallBattleCore - ld a, [OTPartyCount] + ld a, [wOTPartyCount] add BATTLEACTION_SWITCH1 ld b, a ld a, [wBattleAction] @@ -123,7 +123,7 @@ BatonPass_LinkEnemySwitch: ; 37a82 jr c, .switch .baton_pass - ld a, [CurOTMon] + ld a, [wCurOTMon] add BATTLEACTION_SWITCH1 ld [wBattleAction], a .switch @@ -157,11 +157,11 @@ ResetBatonPassStatus: ; 37ab1 call ResetActorDisable ; Attraction isn't passed. - ld hl, PlayerSubStatus1 + ld hl, wPlayerSubStatus1 res SUBSTATUS_IN_LOVE, [hl] - ld hl, EnemySubStatus1 + ld hl, wEnemySubStatus1 res SUBSTATUS_IN_LOVE, [hl] - ld hl, PlayerSubStatus5 + ld hl, wPlayerSubStatus5 ld a, BATTLE_VARS_SUBSTATUS5 call GetBattleVarAddr @@ -182,10 +182,10 @@ ResetBatonPassStatus: ; 37ab1 CheckAnyOtherAlivePartyMons: ; 37ae9 - ld hl, PartyMon1HP - ld a, [PartyCount] + ld hl, wPartyMon1HP + ld a, [wPartyCount] ld d, a - ld a, [CurBattleMon] + ld a, [wCurBattleMon] ld e, a jr CheckAnyOtherAliveMons @@ -193,10 +193,10 @@ CheckAnyOtherAlivePartyMons: ; 37ae9 CheckAnyOtherAliveEnemyMons: ; 37af6 - ld hl, OTPartyMon1HP - ld a, [OTPartyCount] + ld hl, wOTPartyMon1HP + ld a, [wOTPartyCount] ld d, a - ld a, [CurOTMon] + ld a, [wCurOTMon] ld e, a ; fallthrough diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm index 31b07726e..18e350504 100644 --- a/engine/battle/move_effects/beat_up.asm +++ b/engine/battle/move_effects/beat_up.asm @@ -5,27 +5,27 @@ BattleCommand_BeatUp: ; 35461 ld a, [hBattleTurn] and a jp nz, .enemy_beats_up - ld a, [PlayerSubStatus3] + ld a, [wPlayerSubStatus3] bit SUBSTATUS_IN_LOOP, a jr nz, .next_mon ld c, 20 call DelayFrames xor a - ld [PlayerRolloutCount], a + ld [wPlayerRolloutCount], a ld [wd002], a ld [wBeatUpHitAtLeastOnce], a jr .got_mon .next_mon - ld a, [PlayerRolloutCount] + ld a, [wPlayerRolloutCount] ld b, a - ld a, [PartyCount] + ld a, [wPartyCount] sub b ld [wd002], a .got_mon ld a, [wd002] - ld hl, PartyMonNicknames + ld hl, wPartyMonNicknames call GetNick ld a, MON_HP call GetBeatupMonLocation @@ -34,11 +34,11 @@ BattleCommand_BeatUp: ; 35461 jp z, .beatup_fail ; fainted ld a, [wd002] ld c, a - ld a, [CurBattleMon] + ld a, [wCurBattleMon] ; BUG: this can desynchronize link battles ; Change "cp [hl]" to "cp c" to fix cp [hl] - ld hl, BattleMonStatus + ld hl, wBattleMonStatus jr z, .active_mon ld a, MON_STATUS call GetBeatupMonLocation @@ -51,18 +51,18 @@ BattleCommand_BeatUp: ; 35461 ld [wBeatUpHitAtLeastOnce], a ld hl, BeatUpAttackText call StdBattleTextBox - ld a, [EnemyMonSpecies] - ld [CurSpecies], a + ld a, [wEnemyMonSpecies] + ld [wCurSpecies], a call GetBaseData - ld a, [BaseDefense] + ld a, [wBaseDefense] ld c, a push bc ld a, MON_SPECIES call GetBeatupMonLocation ld a, [hl] - ld [CurSpecies], a + ld [wCurSpecies], a call GetBaseData - ld a, [BaseAttack] + ld a, [wBaseAttack] pop bc ld b, a push bc @@ -76,20 +76,20 @@ BattleCommand_BeatUp: ; 35461 ret .enemy_beats_up - ld a, [EnemySubStatus3] + ld a, [wEnemySubStatus3] bit SUBSTATUS_IN_LOOP, a jr nz, .not_first_enemy_beatup xor a - ld [EnemyRolloutCount], a + ld [wEnemyRolloutCount], a ld [wd002], a ld [wBeatUpHitAtLeastOnce], a jr .enemy_continue .not_first_enemy_beatup - ld a, [EnemyRolloutCount] + ld a, [wEnemyRolloutCount] ld b, a - ld a, [OTPartyCount] + ld a, [wOTPartyCount] sub b ld [wd002], a .enemy_continue @@ -101,14 +101,14 @@ BattleCommand_BeatUp: ; 35461 and a jr nz, .link_or_tower - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a jr nz, .link_or_tower ld a, [wd002] ld c, a ld b, 0 - ld hl, OTPartySpecies + ld hl, wOTPartySpecies add hl, bc ld a, [hl] ld [wNamedObjectIndexBuffer], a @@ -117,10 +117,10 @@ BattleCommand_BeatUp: ; 35461 .link_or_tower ld a, [wd002] - ld hl, OTPartyMonNicknames + ld hl, wOTPartyMonNicknames ld bc, NAME_LENGTH call AddNTimes - ld de, StringBuffer1 + ld de, wStringBuffer1 call CopyBytes .got_enemy_nick ld a, MON_HP @@ -130,9 +130,9 @@ BattleCommand_BeatUp: ; 35461 jp z, .beatup_fail ld a, [wd002] ld b, a - ld a, [CurOTMon] + ld a, [wCurOTMon] cp b - ld hl, EnemyMonStatus + ld hl, wEnemyMonStatus jr z, .active_enemy ld a, MON_STATUS @@ -147,7 +147,7 @@ BattleCommand_BeatUp: ; 35461 jr .finish_beatup .wild - ld a, [EnemyMonSpecies] + ld a, [wEnemyMonSpecies] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld hl, BeatUpAttackText @@ -157,18 +157,18 @@ BattleCommand_BeatUp: ; 35461 .finish_beatup ld hl, BeatUpAttackText call StdBattleTextBox - ld a, [BattleMonSpecies] - ld [CurSpecies], a + ld a, [wBattleMonSpecies] + ld [wCurSpecies], a call GetBaseData - ld a, [BaseDefense] + ld a, [wBaseDefense] ld c, a push bc ld a, MON_SPECIES call GetBeatupMonLocation ld a, [hl] - ld [CurSpecies], a + ld [wCurSpecies], a call GetBaseData - ld a, [BaseAttack] + ld a, [wBaseAttack] pop bc ld b, a push bc @@ -207,9 +207,9 @@ GetBeatupMonLocation: ; 355bd ld b, 0 ld a, [hBattleTurn] and a - ld hl, PartyMon1Species + ld hl, wPartyMon1Species jr z, .got_species - ld hl, OTPartyMon1Species + ld hl, wOTPartyMon1Species .got_species ld a, [wd002] diff --git a/engine/battle/move_effects/belly_drum.asm b/engine/battle/move_effects/belly_drum.asm index eea10ef8a..bd300c9cd 100644 --- a/engine/battle/move_effects/belly_drum.asm +++ b/engine/battle/move_effects/belly_drum.asm @@ -4,7 +4,7 @@ BattleCommand_BellyDrum: ; 37c1a ; before checking that it has enough HP to use the move. ; Swap the order of these two blocks to fix. call BattleCommand_AttackUp2 - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed diff --git a/engine/battle/move_effects/bide.asm b/engine/battle/move_effects/bide.asm index 608bcff37..d9958ca53 100644 --- a/engine/battle/move_effects/bide.asm +++ b/engine/battle/move_effects/bide.asm @@ -6,11 +6,11 @@ BattleCommand_StoreEnergy: ; 36671 bit SUBSTATUS_BIDE, a ret z - ld hl, PlayerRolloutCount + ld hl, wPlayerRolloutCount ld a, [hBattleTurn] and a jr z, .check_still_storing_energy - ld hl, EnemyRolloutCount + ld hl, wEnemyRolloutCount .check_still_storing_energy dec [hl] jr nz, .still_storing @@ -26,30 +26,30 @@ BattleCommand_StoreEnergy: ; 36671 call GetBattleVarAddr ld a, 1 ld [hl], a - ld hl, PlayerDamageTaken + 1 + ld hl, wPlayerDamageTaken + 1 ld de, wPlayerCharging ; player ld a, [hBattleTurn] and a jr z, .player - ld hl, EnemyDamageTaken + 1 + ld hl, wEnemyDamageTaken + 1 ld de, wEnemyCharging ; enemy .player ld a, [hld] add a ld b, a - ld [CurDamage + 1], a + ld [wCurDamage + 1], a ld a, [hl] rl a - ld [CurDamage], a + ld [wCurDamage], a jr nc, .not_maxed ld a, $ff - ld [CurDamage], a - ld [CurDamage + 1], a + ld [wCurDamage], a + ld [wCurDamage + 1], a .not_maxed or b jr nz, .built_up_something ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a .built_up_something xor a ld [hli], a @@ -75,13 +75,13 @@ BattleCommand_StoreEnergy: ; 36671 BattleCommand_UnleashEnergy: ; 366e5 ; unleashenergy - ld de, PlayerDamageTaken - ld bc, PlayerRolloutCount + ld de, wPlayerDamageTaken + ld bc, wPlayerRolloutCount ld a, [hBattleTurn] and a jr z, .got_damage - ld de, EnemyDamageTaken - ld bc, EnemyRolloutCount + ld de, wEnemyDamageTaken + ld bc, wEnemyRolloutCount .got_damage ld a, BATTLE_VARS_SUBSTATUS3 call GetBattleVarAddr diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm index cb20d6801..d66d23a5e 100644 --- a/engine/battle/move_effects/conversion.asm +++ b/engine/battle/move_effects/conversion.asm @@ -1,17 +1,17 @@ BattleCommand_Conversion: ; 3707f ; conversion - ld hl, BattleMonMoves - ld de, BattleMonType1 + ld hl, wBattleMonMoves + ld de, wBattleMonType1 ld a, [hBattleTurn] and a jr z, .got_moves - ld hl, EnemyMonMoves - ld de, EnemyMonType1 + ld hl, wEnemyMonMoves + ld de, wEnemyMonType1 .got_moves push de ld c, 0 - ld de, StringBuffer1 + ld de, wStringBuffer1 .loop push hl ld b, 0 @@ -41,7 +41,7 @@ BattleCommand_Conversion: ; 3707f inc de ld [de], a pop de - ld hl, StringBuffer1 + ld hl, wStringBuffer1 .loop2 ld a, [hl] cp -1 @@ -70,7 +70,7 @@ BattleCommand_Conversion: ; 3707f maskbits NUM_MOVES ld c, a ld b, 0 - ld hl, StringBuffer1 + ld hl, wStringBuffer1 add hl, bc ld a, [hl] cp -1 diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm index f4fbe768c..7fefbfee5 100644 --- a/engine/battle/move_effects/conversion2.asm +++ b/engine/battle/move_effects/conversion2.asm @@ -1,14 +1,14 @@ BattleCommand_Conversion2: ; 359e6 ; conversion2 - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed - ld hl, BattleMonType1 + ld hl, wBattleMonType1 ld a, [hBattleTurn] and a jr z, .got_type - ld hl, EnemyMonType1 + ld hl, wEnemyMonType1 .got_type ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar diff --git a/engine/battle/move_effects/counter.asm b/engine/battle/move_effects/counter.asm index c32a79c14..b811b293c 100644 --- a/engine/battle/move_effects/counter.asm +++ b/engine/battle/move_effects/counter.asm @@ -2,7 +2,7 @@ BattleCommand_Counter: ; 35813 ; counter ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar and a @@ -25,18 +25,18 @@ BattleCommand_Counter: ; 35813 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar dec a - ld de, StringBuffer1 + ld de, wStringBuffer1 call GetMoveData - ld a, [StringBuffer1 + MOVE_POWER] + ld a, [wStringBuffer1 + MOVE_POWER] and a ret z - ld a, [StringBuffer1 + MOVE_TYPE] + ld a, [wStringBuffer1 + MOVE_TYPE] cp SPECIAL ret nc - ld hl, CurDamage + ld hl, wCurDamage ld a, [hli] or [hl] ret z @@ -54,7 +54,7 @@ BattleCommand_Counter: ; 35813 .capped xor a - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 35864 diff --git a/engine/battle/move_effects/curse.asm b/engine/battle/move_effects/curse.asm index dceb3b8d5..b11b9f3fb 100644 --- a/engine/battle/move_effects/curse.asm +++ b/engine/battle/move_effects/curse.asm @@ -1,13 +1,13 @@ BattleCommand_Curse: ; 37588 ; curse - ld de, BattleMonType1 - ld bc, PlayerStatLevels + ld de, wBattleMonType1 + ld bc, wPlayerStatLevels ld a, [hBattleTurn] and a jr z, .go - ld de, EnemyMonType1 - ld bc, EnemyStatLevels + ld de, wEnemyMonType1 + ld bc, wEnemyStatLevels .go diff --git a/engine/battle/move_effects/disable.asm b/engine/battle/move_effects/disable.asm index 370d6cc86..5df785d24 100644 --- a/engine/battle/move_effects/disable.asm +++ b/engine/battle/move_effects/disable.asm @@ -1,17 +1,17 @@ BattleCommand_Disable: ; 36fed ; disable - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed - ld de, EnemyDisableCount - ld hl, EnemyMonMoves + ld de, wEnemyDisableCount + ld hl, wEnemyMonMoves ld a, [hBattleTurn] and a jr z, .got_moves - ld de, PlayerDisableCount - ld hl, BattleMonMoves + ld de, wPlayerDisableCount + ld hl, wBattleMonMoves .got_moves ld a, [de] @@ -35,9 +35,9 @@ BattleCommand_Disable: ; 36fed ld a, [hBattleTurn] and a - ld hl, EnemyMonPP + ld hl, wEnemyMonPP jr z, .got_pp - ld hl, BattleMonPP + ld hl, wBattleMonPP .got_pp ld b, 0 add hl, bc @@ -54,7 +54,7 @@ BattleCommand_Disable: ; 36fed add c ld [de], a call AnimateCurrentMove - ld hl, DisabledMove + ld hl, wDisabledMove ld a, [hBattleTurn] and a jr nz, .got_disabled_move_pointer diff --git a/engine/battle/move_effects/encore.asm b/engine/battle/move_effects/encore.asm index 316c53f2c..e6607fb11 100644 --- a/engine/battle/move_effects/encore.asm +++ b/engine/battle/move_effects/encore.asm @@ -1,13 +1,13 @@ BattleCommand_Encore: ; 35864 ; encore - ld hl, EnemyMonMoves - ld de, EnemyEncoreCount + ld hl, wEnemyMonMoves + ld de, wEnemyEncoreCount ld a, [hBattleTurn] and a jr z, .ok - ld hl, BattleMonMoves - ld de, PlayerEncoreCount + ld hl, wBattleMonMoves + ld de, wPlayerEncoreCount .ok ld a, BATTLE_VARS_LAST_MOVE_OPP call GetBattleVar @@ -26,12 +26,12 @@ BattleCommand_Encore: ; 35864 cp b jr nz, .got_move - ld bc, BattleMonPP - BattleMonMoves - 1 + ld bc, wBattleMonPP - wBattleMonMoves - 1 add hl, bc ld a, [hl] and PP_MASK jp z, .failed - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, .failed ld a, BATTLE_VARS_SUBSTATUS5_OPP @@ -52,10 +52,10 @@ BattleCommand_Encore: ; 35864 jr z, .force_last_enemy_move push hl - ld a, [LastPlayerMove] + ld a, [wLastPlayerMove] ld b, a ld c, 0 - ld hl, BattleMonMoves + ld hl, wBattleMonMoves .find_player_move ld a, [hli] cp b @@ -73,9 +73,9 @@ BattleCommand_Encore: ; 35864 .got_player_move pop hl ld a, c - ld [CurMoveNum], a + ld [wCurMoveNum], a ld a, b - ld [CurPlayerMove], a + ld [wCurPlayerMove], a dec a ld de, wPlayerMoveStruct call GetMoveData @@ -83,10 +83,10 @@ BattleCommand_Encore: ; 35864 .force_last_enemy_move push hl - ld a, [LastEnemyMove] + ld a, [wLastEnemyMove] ld b, a ld c, 0 - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves .find_enemy_move ld a, [hli] cp b @@ -104,9 +104,9 @@ BattleCommand_Encore: ; 35864 .got_enemy_move pop hl ld a, c - ld [CurEnemyMoveNum], a + ld [wCurEnemyMoveNum], a ld a, b - ld [CurEnemyMove], a + ld [wCurEnemyMove], a dec a ld de, wEnemyMoveStruct call GetMoveData diff --git a/engine/battle/move_effects/false_swipe.asm b/engine/battle/move_effects/false_swipe.asm index ae8bcedb3..e93b627ec 100644 --- a/engine/battle/move_effects/false_swipe.asm +++ b/engine/battle/move_effects/false_swipe.asm @@ -1,13 +1,13 @@ BattleCommand_FalseSwipe: ; 35c94 ; falseswipe - ld hl, EnemyMonHP + ld hl, wEnemyMonHP ld a, [hBattleTurn] and a jr z, .got_hp - ld hl, BattleMonHP + ld hl, wBattleMonHP .got_hp - ld de, CurDamage + ld de, wCurDamage ld c, 2 push hl push de @@ -28,11 +28,11 @@ BattleCommand_FalseSwipe: ; 35c94 dec a ld [de], a .okay - ld a, [CriticalHit] + ld a, [wCriticalHit] cp 2 jr nz, .carry xor a - ld [CriticalHit], a + ld [wCriticalHit], a .carry scf ret diff --git a/engine/battle/move_effects/foresight.asm b/engine/battle/move_effects/foresight.asm index 0e6b1dd4e..8c51bb220 100644 --- a/engine/battle/move_effects/foresight.asm +++ b/engine/battle/move_effects/foresight.asm @@ -1,7 +1,7 @@ BattleCommand_Foresight: ; 376a0 ; foresight - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed diff --git a/engine/battle/move_effects/frustration.asm b/engine/battle/move_effects/frustration.asm index ddf09afb1..3f8456ced 100644 --- a/engine/battle/move_effects/frustration.asm +++ b/engine/battle/move_effects/frustration.asm @@ -2,11 +2,11 @@ BattleCommand_FrustrationPower: ; 3790e ; frustrationpower push bc - ld hl, BattleMonHappiness + ld hl, wBattleMonHappiness ld a, [hBattleTurn] and a jr z, .got_happiness - ld hl, EnemyMonHappiness + ld hl, wEnemyMonHappiness .got_happiness ld a, $ff sub [hl] diff --git a/engine/battle/move_effects/fury_cutter.asm b/engine/battle/move_effects/fury_cutter.asm index 9a667552a..91679368f 100644 --- a/engine/battle/move_effects/fury_cutter.asm +++ b/engine/battle/move_effects/fury_cutter.asm @@ -1,14 +1,14 @@ BattleCommand_FuryCutter: ; 37792 ; furycutter - ld hl, PlayerFuryCutterCount + ld hl, wPlayerFuryCutterCount ld a, [hBattleTurn] and a jr z, .go - ld hl, EnemyFuryCutterCount + ld hl, wEnemyFuryCutterCount .go - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, ResetFuryCutterCount @@ -26,7 +26,7 @@ BattleCommand_FuryCutter: ; 37792 ret z ; Double the damage - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] @@ -45,11 +45,11 @@ ResetFuryCutterCount: ; 377be push hl - ld hl, PlayerFuryCutterCount + ld hl, wPlayerFuryCutterCount ld a, [hBattleTurn] and a jr z, .reset - ld hl, EnemyFuryCutterCount + ld hl, wEnemyFuryCutterCount .reset xor a diff --git a/engine/battle/move_effects/future_sight.asm b/engine/battle/move_effects/future_sight.asm index cd01db838..fa2148ab7 100644 --- a/engine/battle/move_effects/future_sight.asm +++ b/engine/battle/move_effects/future_sight.asm @@ -19,9 +19,9 @@ BattleCommand_CheckFutureSight: ; 37d0d ld [hl], 0 ld a, [de] inc de - ld [CurDamage], a + ld [wCurDamage], a ld a, [de] - ld [CurDamage + 1], a + ld [wCurDamage + 1], a ld b, futuresight_command jp SkipToBattleCommand @@ -64,7 +64,7 @@ BattleCommand_FutureSight: ; 37d34 jr z, .StoreDamage ld de, wEnemyFutureSightDamage .StoreDamage: - ld hl, CurDamage + ld hl, wCurDamage ld a, [hl] ld [de], a ld [hl], 0 diff --git a/engine/battle/move_effects/heal_bell.asm b/engine/battle/move_effects/heal_bell.asm index b4f6ccecb..c79362f9c 100644 --- a/engine/battle/move_effects/heal_bell.asm +++ b/engine/battle/move_effects/heal_bell.asm @@ -4,11 +4,11 @@ BattleCommand_HealBell: ; 35cc9 ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVarAddr res SUBSTATUS_NIGHTMARE, [hl] - ld de, PartyMon1Status + ld de, wPartyMon1Status ld a, [hBattleTurn] and a jr z, .got_status - ld de, OTPartyMon1Status + ld de, wOTPartyMon1Status .got_status ld a, BATTLE_VARS_STATUS call GetBattleVarAddr diff --git a/engine/battle/move_effects/hidden_power.asm b/engine/battle/move_effects/hidden_power.asm index 8fbdba42d..f96becf97 100644 --- a/engine/battle/move_effects/hidden_power.asm +++ b/engine/battle/move_effects/hidden_power.asm @@ -1,7 +1,7 @@ BattleCommand_HiddenPower: ; 37be8 ; hiddenpower - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz farcall HiddenPowerDamage diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm index 25f7a9a18..328a2c416 100644 --- a/engine/battle/move_effects/leech_seed.asm +++ b/engine/battle/move_effects/leech_seed.asm @@ -1,16 +1,16 @@ BattleCommand_LeechSeed: ; 36f9d ; leechseed - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .evaded call CheckSubstituteOpp jr nz, .evaded - ld de, EnemyMonType1 + ld de, wEnemyMonType1 ld a, [hBattleTurn] and a jr z, .ok - ld de, BattleMonType1 + ld de, wBattleMonType1 .ok ld a, [de] diff --git a/engine/battle/move_effects/lock_on.asm b/engine/battle/move_effects/lock_on.asm index de92e0751..36d8db926 100644 --- a/engine/battle/move_effects/lock_on.asm +++ b/engine/battle/move_effects/lock_on.asm @@ -4,7 +4,7 @@ BattleCommand_LockOn: ; 35a53 call CheckSubstituteOpp jr nz, .fail - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .fail diff --git a/engine/battle/move_effects/mimic.asm b/engine/battle/move_effects/mimic.asm index c1a3bc592..712b42df1 100644 --- a/engine/battle/move_effects/mimic.asm +++ b/engine/battle/move_effects/mimic.asm @@ -3,14 +3,14 @@ BattleCommand_Mimic: ; 36f46 call ClearLastMove call BattleCommand_MoveDelay - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .fail - ld hl, BattleMonMoves + ld hl, wBattleMonMoves ld a, [hBattleTurn] and a jr z, .player_turn - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves .player_turn call CheckHiddenOpponent jr nz, .fail @@ -38,7 +38,7 @@ BattleCommand_Mimic: ; 36f46 call GetBattleVar ld [hl], a ld [wNamedObjectIndexBuffer], a - ld bc, BattleMonPP - BattleMonMoves + ld bc, wBattleMonPP - wBattleMonMoves add hl, bc ld [hl], 5 call GetMoveName diff --git a/engine/battle/move_effects/mirror_coat.asm b/engine/battle/move_effects/mirror_coat.asm index 8e9c7c1b4..41e296108 100644 --- a/engine/battle/move_effects/mirror_coat.asm +++ b/engine/battle/move_effects/mirror_coat.asm @@ -2,7 +2,7 @@ BattleCommand_MirrorCoat: ; 37c95 ; mirrorcoat ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar @@ -26,18 +26,18 @@ BattleCommand_MirrorCoat: ; 37c95 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar dec a - ld de, StringBuffer1 + ld de, wStringBuffer1 call GetMoveData - ld a, [StringBuffer1 + 2] + ld a, [wStringBuffer1 + 2] and a ret z - ld a, [StringBuffer1 + 3] + ld a, [wStringBuffer1 + 3] cp SPECIAL ret c - ld hl, CurDamage + ld hl, wCurDamage ld a, [hli] or [hl] ret z @@ -55,7 +55,7 @@ BattleCommand_MirrorCoat: ; 37c95 .capped xor a - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 37ce6 diff --git a/engine/battle/move_effects/pain_split.asm b/engine/battle/move_effects/pain_split.asm index 5a6b72686..2db3726c6 100644 --- a/engine/battle/move_effects/pain_split.asm +++ b/engine/battle/move_effects/pain_split.asm @@ -1,28 +1,28 @@ BattleCommand_PainSplit: ; 35926 ; painsplit - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, .ButItFailed call CheckSubstituteOpp jp nz, .ButItFailed call AnimateCurrentMove - ld hl, BattleMonMaxHP + 1 - ld de, EnemyMonMaxHP + 1 + ld hl, wBattleMonMaxHP + 1 + ld de, wEnemyMonMaxHP + 1 call .PlayerShareHP ld a, $1 ld [wWhichHPBar], a hlcoord 10, 9 predef AnimateHPBar - ld hl, EnemyMonHP + ld hl, wEnemyMonHP ld a, [hli] - ld [Buffer4], a + ld [wBuffer4], a ld a, [hli] - ld [Buffer3], a + ld [wBuffer3], a ld a, [hli] - ld [Buffer2], a + ld [wBuffer2], a ld a, [hl] - ld [Buffer1], a + ld [wBuffer1], a call .EnemyShareHP xor a ld [wWhichHPBar], a @@ -36,28 +36,28 @@ BattleCommand_PainSplit: ; 35926 .PlayerShareHP: ld a, [hld] - ld [Buffer1], a + ld [wBuffer1], a ld a, [hld] - ld [Buffer2], a + ld [wBuffer2], a ld a, [hld] ld b, a - ld [Buffer3], a + ld [wBuffer3], a ld a, [hl] - ld [Buffer4], a + ld [wBuffer4], a dec de dec de ld a, [de] dec de add b - ld [CurDamage + 1], a + ld [wCurDamage + 1], a ld b, [hl] ld a, [de] adc b srl a - ld [CurDamage], a - ld a, [CurDamage + 1] + ld [wCurDamage], a + ld a, [wCurDamage + 1] rr a - ld [CurDamage + 1], a + ld [wCurDamage + 1], a inc hl inc hl inc hl @@ -68,25 +68,25 @@ BattleCommand_PainSplit: ; 35926 .EnemyShareHP: ; 359ac ld c, [hl] dec hl - ld a, [CurDamage + 1] + ld a, [wCurDamage + 1] sub c ld b, [hl] dec hl - ld a, [CurDamage] + ld a, [wCurDamage] sbc b jr nc, .skip - ld a, [CurDamage] + ld a, [wCurDamage] ld b, a - ld a, [CurDamage + 1] + ld a, [wCurDamage + 1] ld c, a .skip ld a, c ld [hld], a - ld [Buffer5], a + ld [wBuffer5], a ld a, b ld [hli], a - ld [Buffer6], a + ld [wBuffer6], a ret ; 359cd diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm index 05231fc1a..a5d2fed0d 100644 --- a/engine/battle/move_effects/pay_day.asm +++ b/engine/battle/move_effects/pay_day.asm @@ -2,14 +2,14 @@ BattleCommand_PayDay: ; 3705c ; payday xor a - ld hl, StringBuffer1 + ld hl, wStringBuffer1 ld [hli], a ld a, [hBattleTurn] and a - ld a, [BattleMonLevel] + ld a, [wBattleMonLevel] jr z, .ok - ld a, [EnemyMonLevel] + ld a, [wEnemyMonLevel] .ok add a diff --git a/engine/battle/move_effects/perish_song.asm b/engine/battle/move_effects/perish_song.asm index ac491ef6b..8c88c8739 100644 --- a/engine/battle/move_effects/perish_song.asm +++ b/engine/battle/move_effects/perish_song.asm @@ -2,8 +2,8 @@ BattleCommand_PerishSong: ; 376c2 ; perishsong - ld hl, PlayerSubStatus1 - ld de, EnemySubStatus1 + ld hl, wPlayerSubStatus1 + ld de, wEnemySubStatus1 bit SUBSTATUS_PERISH, [hl] jr z, .ok @@ -17,7 +17,7 @@ BattleCommand_PerishSong: ; 376c2 set SUBSTATUS_PERISH, [hl] ld a, 4 - ld [PlayerPerishCount], a + ld [wPlayerPerishCount], a .enemy ld a, [de] @@ -27,7 +27,7 @@ BattleCommand_PerishSong: ; 376c2 set SUBSTATUS_PERISH, a ld [de], a ld a, 4 - ld [EnemyPerishCount], a + ld [wEnemyPerishCount], a .done call AnimateCurrentMove diff --git a/engine/battle/move_effects/present.asm b/engine/battle/move_effects/present.asm index 24db2a7fb..a2ef5bc64 100755 --- a/engine/battle/move_effects/present.asm +++ b/engine/battle/move_effects/present.asm @@ -20,7 +20,7 @@ BattleCommand_Present: ; 37874 ld a, [wTypeMatchup] and a jp z, AnimateFailedMove - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, AnimateFailedMove diff --git a/engine/battle/move_effects/protect.asm b/engine/battle/move_effects/protect.asm index 568ac00f8..6c65e0ed1 100644 --- a/engine/battle/move_effects/protect.asm +++ b/engine/battle/move_effects/protect.asm @@ -16,11 +16,11 @@ BattleCommand_Protect: ; 37618 ProtectChance: ; 3762c - ld de, PlayerProtectCount + ld de, wPlayerProtectCount ld a, [hBattleTurn] and a jr z, .asm_37637 - ld de, EnemyProtectCount + ld de, wEnemyProtectCount .asm_37637 call CheckOpponentWentFirst diff --git a/engine/battle/move_effects/psych_up.asm b/engine/battle/move_effects/psych_up.asm index c7e7e59b6..c57fff9cd 100644 --- a/engine/battle/move_effects/psych_up.asm +++ b/engine/battle/move_effects/psych_up.asm @@ -1,8 +1,8 @@ BattleCommand_PsychUp: ; 37c55 ; psychup - ld hl, EnemyStatLevels - ld de, PlayerStatLevels + ld hl, wEnemyStatLevels + ld de, wPlayerStatLevels ld a, [hBattleTurn] and a jr z, .pointers_correct diff --git a/engine/battle/move_effects/pursuit.asm b/engine/battle/move_effects/pursuit.asm index c75204fb3..969e08f73 100644 --- a/engine/battle/move_effects/pursuit.asm +++ b/engine/battle/move_effects/pursuit.asm @@ -12,7 +12,7 @@ BattleCommand_Pursuit: ; 37b1d and a ret z - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] diff --git a/engine/battle/move_effects/rain_dance.asm b/engine/battle/move_effects/rain_dance.asm index 8448ccb57..6c587d551 100644 --- a/engine/battle/move_effects/rain_dance.asm +++ b/engine/battle/move_effects/rain_dance.asm @@ -1,9 +1,9 @@ BattleCommand_StartRain: ; 37bf4 ; startrain ld a, WEATHER_RAIN - ld [Weather], a + ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a 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 e429d9cb2..84bcbad7f 100644 --- a/engine/battle/move_effects/rapid_spin.asm +++ b/engine/battle/move_effects/rapid_spin.asm @@ -10,12 +10,12 @@ BattleCommand_ClearHazards: ; 37b39 call StdBattleTextBox .not_leeched - ld hl, PlayerScreens + ld hl, wPlayerScreens ld de, wPlayerWrapCount ld a, [hBattleTurn] and a jr z, .got_screens_wrap - ld hl, EnemyScreens + ld hl, wEnemyScreens ld de, wEnemyWrapCount .got_screens_wrap bit SCREENS_SPIKES, [hl] diff --git a/engine/battle/move_effects/return.asm b/engine/battle/move_effects/return.asm index 8d8046385..e1d568e7c 100644 --- a/engine/battle/move_effects/return.asm +++ b/engine/battle/move_effects/return.asm @@ -1,11 +1,11 @@ BattleCommand_HappinessPower: ; 3784b ; happinesspower push bc - ld hl, BattleMonHappiness + ld hl, wBattleMonHappiness ld a, [hBattleTurn] and a jr z, .ok - ld hl, EnemyMonHappiness + ld hl, wEnemyMonHappiness .ok xor a ld [hMultiplicand + 0], a diff --git a/engine/battle/move_effects/rollout.asm b/engine/battle/move_effects/rollout.asm index 4ce9ab3d8..f6966c48a 100644 --- a/engine/battle/move_effects/rollout.asm +++ b/engine/battle/move_effects/rollout.asm @@ -4,11 +4,11 @@ MAX_ROLLOUT_COUNT EQU 5 BattleCommand_CheckCurl: ; 37718 ; checkcurl - ld de, PlayerRolloutCount + ld de, wPlayerRolloutCount ld a, [hBattleTurn] and a jr z, .ok - ld de, EnemyRolloutCount + ld de, wEnemyRolloutCount .ok ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVar @@ -33,11 +33,11 @@ BattleCommand_RolloutPower: ; 37734 and SLP ret nz - ld hl, PlayerRolloutCount + ld hl, wPlayerRolloutCount ld a, [hBattleTurn] and a jr z, .got_rollout_count - ld hl, EnemyRolloutCount + ld hl, wEnemyRolloutCount .got_rollout_count ld a, [hl] @@ -47,7 +47,7 @@ BattleCommand_RolloutPower: ; 37734 ld [wSomeoneIsRampaging], a .skip_set_rampage - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr z, .hit @@ -84,7 +84,7 @@ BattleCommand_RolloutPower: ; 37734 dec b jr z, .done_damage - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] diff --git a/engine/battle/move_effects/safeguard.asm b/engine/battle/move_effects/safeguard.asm index cdf5bf7dc..1dc233eab 100644 --- a/engine/battle/move_effects/safeguard.asm +++ b/engine/battle/move_effects/safeguard.asm @@ -1,13 +1,13 @@ BattleCommand_Safeguard: ; 37939 ; safeguard - ld hl, PlayerScreens - ld de, PlayerSafeguardCount + ld hl, wPlayerScreens + ld de, wPlayerSafeguardCount ld a, [hBattleTurn] and a jr z, .ok - ld hl, EnemyScreens - ld de, EnemySafeguardCount + ld hl, wEnemyScreens + ld de, wEnemySafeguardCount .ok bit SCREENS_SAFEGUARD, [hl] jr nz, .failed diff --git a/engine/battle/move_effects/sandstorm.asm b/engine/battle/move_effects/sandstorm.asm index 27b8e8e2c..5aaa61deb 100644 --- a/engine/battle/move_effects/sandstorm.asm +++ b/engine/battle/move_effects/sandstorm.asm @@ -1,14 +1,14 @@ BattleCommand_StartSandstorm: ; 376f8 ; startsandstorm - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_SANDSTORM jr z, .failed ld a, WEATHER_SANDSTORM - ld [Weather], a + ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a call AnimateCurrentMove ld hl, SandstormBrewedText jp StdBattleTextBox diff --git a/engine/battle/move_effects/sketch.asm b/engine/battle/move_effects/sketch.asm index af6f8cc8c..93f7ff30c 100644 --- a/engine/battle/move_effects/sketch.asm +++ b/engine/battle/move_effects/sketch.asm @@ -26,11 +26,11 @@ BattleCommand_Sketch: ; 35a74 ld d, h ld e, l ; Get the battle move structs. - ld hl, BattleMonMoves + ld hl, wBattleMonMoves ld a, [hBattleTurn] and a jr z, .get_last_move - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves .get_last_move ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar @@ -69,7 +69,7 @@ BattleCommand_Sketch: ; 35a74 ld hl, Moves + MOVE_PP call GetMoveAttr pop hl - ld bc, BattleMonPP - BattleMonMoves + ld bc, wBattleMonPP - wBattleMonMoves add hl, bc ld [hl], a pop bc diff --git a/engine/battle/move_effects/sleep_talk.asm b/engine/battle/move_effects/sleep_talk.asm index 254b13814..3f62d4e36 100644 --- a/engine/battle/move_effects/sleep_talk.asm +++ b/engine/battle/move_effects/sleep_talk.asm @@ -2,17 +2,17 @@ BattleCommand_SleepTalk: ; 35b33 ; sleeptalk call ClearLastMove - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .fail ld a, [hBattleTurn] and a - ld hl, BattleMonMoves + 1 - ld a, [DisabledMove] + ld hl, wBattleMonMoves + 1 + ld a, [wDisabledMove] ld d, a jr z, .got_moves - ld hl, EnemyMonMoves + 1 - ld a, [EnemyDisabledMove] + ld hl, wEnemyMonMoves + 1 + ld a, [wEnemyDisabledMove] ld d, a .got_moves ld a, BATTLE_VARS_STATUS @@ -79,10 +79,10 @@ BattleCommand_SleepTalk: ; 35b33 .check_has_usable_move ld a, [hBattleTurn] and a - ld a, [DisabledMove] + ld a, [wDisabledMove] jr z, .got_move_2 - ld a, [EnemyDisabledMove] + ld a, [wEnemyDisabledMove] .got_move_2 ld b, a ld a, BATTLE_VARS_MOVE diff --git a/engine/battle/move_effects/snore.asm b/engine/battle/move_effects/snore.asm index 926ee462d..49fb1b210 100644 --- a/engine/battle/move_effects/snore.asm +++ b/engine/battle/move_effects/snore.asm @@ -6,7 +6,7 @@ BattleCommand_Snore: ; 359d0 ret nz call ResetDamage ld a, $1 - ld [AttackMissed], a + ld [wAttackMissed], a call FailMove jp EndMoveEffect diff --git a/engine/battle/move_effects/spikes.asm b/engine/battle/move_effects/spikes.asm index bc23d6559..6cab0b96f 100644 --- a/engine/battle/move_effects/spikes.asm +++ b/engine/battle/move_effects/spikes.asm @@ -1,11 +1,11 @@ BattleCommand_Spikes: ; 37683 ; spikes - ld hl, EnemyScreens + ld hl, wEnemyScreens ld a, [hBattleTurn] and a jr z, .asm_3768e - ld hl, PlayerScreens + ld hl, wPlayerScreens .asm_3768e ; Fails if spikes are already down! diff --git a/engine/battle/move_effects/spite.asm b/engine/battle/move_effects/spite.asm index 96058de60..30a908ae7 100644 --- a/engine/battle/move_effects/spite.asm +++ b/engine/battle/move_effects/spite.asm @@ -1,15 +1,15 @@ BattleCommand_Spite: ; 35c0f ; spite - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, .failed ld bc, PARTYMON_STRUCT_LENGTH ; ???? - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves ld a, [hBattleTurn] and a jr z, .got_moves - ld hl, BattleMonMoves + ld hl, wBattleMonMoves .got_moves ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar @@ -28,7 +28,7 @@ BattleCommand_Spite: ; 35c0f dec hl ld b, 0 push bc - ld c, BattleMonPP - BattleMonMoves + ld c, wBattleMonPP - wBattleMonMoves add hl, bc pop bc ld a, [hl] diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index c761f88e1..1deaa848d 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -2,13 +2,13 @@ BattleCommand_Substitute: ; 36e7c ; substitute call BattleCommand_MoveDelay - ld hl, BattleMonMaxHP - ld de, PlayerSubstituteHP + ld hl, wBattleMonMaxHP + ld de, wPlayerSubstituteHP ld a, [hBattleTurn] and a jr z, .got_hp - ld hl, EnemyMonMaxHP - ld de, EnemySubstituteHP + ld hl, wEnemyMonMaxHP + ld de, wEnemySubstituteHP .got_hp ld a, BATTLE_VARS_SUBSTATUS4 @@ -61,7 +61,7 @@ BattleCommand_Substitute: ; 36e7c xor a ld [wNumHits], a - ld [FXAnimID + 1], a + ld [wFXAnimID + 1], a ld [wKickCounter], a ld a, SUBSTITUTE call LoadAnim diff --git a/engine/battle/move_effects/sunny_day.asm b/engine/battle/move_effects/sunny_day.asm index 7d8a9cef1..ef8c37c5c 100644 --- a/engine/battle/move_effects/sunny_day.asm +++ b/engine/battle/move_effects/sunny_day.asm @@ -1,9 +1,9 @@ BattleCommand_StartSun: ; 37c07 ; startsun ld a, WEATHER_SUN - ld [Weather], a + ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a call AnimateCurrentMove ld hl, SunGotBrightText jp StdBattleTextBox diff --git a/engine/battle/move_effects/teleport.asm b/engine/battle/move_effects/teleport.asm index e3a0535ca..1bd1eb725 100644 --- a/engine/battle/move_effects/teleport.asm +++ b/engine/battle/move_effects/teleport.asm @@ -1,7 +1,7 @@ BattleCommand_Teleport: ; 36778 ; teleport - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_SHINY jr z, .failed cp BATTLETYPE_TRAP @@ -24,9 +24,9 @@ BattleCommand_Teleport: ; 36778 dec a jr nz, .failed ; If your level is greater than the opponent's, you run without fail. - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] ld b, a - ld a, [BattleMonLevel] + ld a, [wBattleMonLevel] cp b jr nc, .run_away ; Generate a number between 0 and (YourLevel + TheirLevel). @@ -51,9 +51,9 @@ BattleCommand_Teleport: ; 36778 ld a, [wBattleMode] dec a jr nz, .failed - ld a, [BattleMonLevel] + ld a, [wBattleMonLevel] ld b, a - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] cp b jr nc, .run_away add b diff --git a/engine/battle/move_effects/thief.asm b/engine/battle/move_effects/thief.asm index 6d32d68d4..5397c2bdf 100644 --- a/engine/battle/move_effects/thief.asm +++ b/engine/battle/move_effects/thief.asm @@ -26,7 +26,7 @@ BattleCommand_Thief: ; 37492 farcall ItemIsMail ret c - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz @@ -74,7 +74,7 @@ BattleCommand_Thief: ; 37492 farcall ItemIsMail ret c - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz @@ -103,7 +103,7 @@ BattleCommand_Thief: ; 37492 call BattlePartyAttr ld d, h ld e, l - ld hl, BattleMonItem + ld hl, wBattleMonItem ret .enemyitem @@ -111,6 +111,6 @@ BattleCommand_Thief: ; 37492 call OTPartyAttr ld d, h ld e, l - ld hl, EnemyMonItem + ld hl, wEnemyMonItem ret ; 37517 diff --git a/engine/battle/move_effects/thunder.asm b/engine/battle/move_effects/thunder.asm index adfb4dd33..3705e1a28 100644 --- a/engine/battle/move_effects/thunder.asm +++ b/engine/battle/move_effects/thunder.asm @@ -4,7 +4,7 @@ BattleCommand_ThunderAccuracy: ; 37d94 ld a, BATTLE_VARS_MOVE_TYPE call GetBattleVarAddr inc hl - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_RAIN jr z, .rain cp WEATHER_SUN diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm index 65c3f3e60..5ae7c1511 100755 --- a/engine/battle/move_effects/transform.asm +++ b/engine/battle/move_effects/transform.asm @@ -11,7 +11,7 @@ BattleCommand_Transform: ; 371cd jp nz, BattleEffect_ButItFailed xor a ld [wNumHits], a - ld [FXAnimID + 1], a + ld [wFXAnimID + 1], a ld a, $1 ld [wKickCounter], a ld a, BATTLE_VARS_SUBSTATUS4 @@ -28,15 +28,15 @@ BattleCommand_Transform: ; 371cd call GetBattleVarAddr set SUBSTATUS_TRANSFORMED, [hl] call ResetActorDisable - ld hl, BattleMonSpecies - ld de, EnemyMonSpecies + ld hl, wBattleMonSpecies + ld de, wEnemyMonSpecies ld a, [hBattleTurn] and a jr nz, .got_mon_species - ld hl, EnemyMonSpecies - ld de, BattleMonSpecies + ld hl, wEnemyMonSpecies + ld de, wBattleMonSpecies xor a - ld [CurMoveNum], a + ld [wCurMoveNum], a .got_mon_species push hl ld a, [hli] @@ -64,7 +64,7 @@ BattleCommand_Transform: ; 371cd ld [de], a inc de ; move pointer to stats - ld bc, BattleMonStats - BattleMonPP + ld bc, wBattleMonStats - wBattleMonPP add hl, bc push hl ld h, d @@ -73,16 +73,16 @@ BattleCommand_Transform: ; 371cd ld d, h ld e, l pop hl - ld bc, BattleMonStructEnd - BattleMonStats + ld bc, wBattleMonStructEnd - wBattleMonStats call CopyBytes ; init the power points - ld bc, BattleMonMoves - BattleMonStructEnd + ld bc, wBattleMonMoves - wBattleMonStructEnd add hl, bc push de ld d, h ld e, l pop hl - ld bc, BattleMonPP - BattleMonStructEnd + ld bc, wBattleMonPP - wBattleMonStructEnd add hl, bc ld b, NUM_MOVES .pp_loop @@ -102,12 +102,12 @@ BattleCommand_Transform: ; 371cd ld a, [hl] ld [wNamedObjectIndexBuffer], a call GetPokemonName - ld hl, EnemyStats - ld de, PlayerStats + ld hl, wEnemyStats + ld de, wPlayerStats ld bc, 2 * 5 call BattleSideCopy - ld hl, EnemyStatLevels - ld de, PlayerStatLevels + ld hl, wEnemyStatLevels + ld de, wPlayerStatLevels ld bc, 8 call BattleSideCopy call _CheckBattleScene @@ -129,7 +129,7 @@ BattleCommand_Transform: ; 371cd .after_anim xor a ld [wNumHits], a - ld [FXAnimID + 1], a + ld [wFXAnimID + 1], a ld a, $2 ld [wKickCounter], a pop af diff --git a/engine/battle/move_effects/triple_kick.asm b/engine/battle/move_effects/triple_kick.asm index e66e5a9a7..cef56a1ae 100644 --- a/engine/battle/move_effects/triple_kick.asm +++ b/engine/battle/move_effects/triple_kick.asm @@ -4,7 +4,7 @@ BattleCommand_TripleKick: ; 346b2 ld a, [wKickCounter] ld b, a inc b - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 ld a, [hld] ld e, a ld a, [hli] |