summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/battle/ai/move.asm1
-rw-r--r--engine/battle/ai/scoring.asm181
-rw-r--r--engine/battle/battle_transition.asm2
-rw-r--r--engine/battle/consumehelditem.asm29
-rw-r--r--engine/battle/core.asm114
-rw-r--r--engine/battle/effect_commands.asm2678
-rwxr-xr-xengine/battle/menu.asm18
-rw-r--r--engine/battle/misc.asm41
-rwxr-xr-xengine/battle/move_effects/attract.asm (renamed from engine/battle/effect_commands/attract.asm)2
-rw-r--r--engine/battle/move_effects/baton_pass.asm241
-rw-r--r--engine/battle/move_effects/beat_up.asm219
-rw-r--r--engine/battle/move_effects/belly_drum.asm36
-rw-r--r--engine/battle/move_effects/bide.asm105
-rw-r--r--engine/battle/move_effects/conversion.asm98
-rw-r--r--engine/battle/move_effects/conversion2.asm66
-rw-r--r--engine/battle/move_effects/counter.asm60
-rw-r--r--engine/battle/move_effects/curse.asm (renamed from engine/battle/effect_commands/curse.asm)0
-rw-r--r--engine/battle/move_effects/destiny_bond.asm11
-rw-r--r--engine/battle/move_effects/disable.asm74
-rw-r--r--engine/battle/move_effects/encore.asm122
-rw-r--r--engine/battle/move_effects/endure.asm (renamed from engine/battle/effect_commands/endure.asm)0
-rw-r--r--engine/battle/move_effects/false_swipe.asm44
-rw-r--r--engine/battle/move_effects/focus_energy.asm17
-rw-r--r--engine/battle/move_effects/foresight.asm (renamed from engine/battle/effect_commands/foresight.asm)2
-rw-r--r--engine/battle/move_effects/frustration.asm29
-rw-r--r--engine/battle/move_effects/fury_cutter.asm61
-rw-r--r--engine/battle/move_effects/future_sight.asm85
-rw-r--r--engine/battle/move_effects/heal_bell.asm36
-rw-r--r--engine/battle/move_effects/hidden_power.asm10
-rw-r--r--engine/battle/move_effects/leech_seed.asm42
-rw-r--r--engine/battle/move_effects/lock_on.asm23
-rw-r--r--engine/battle/move_effects/magnitude.asm29
-rw-r--r--engine/battle/move_effects/metronome.asm (renamed from engine/battle/effect_commands/metronome.asm)17
-rw-r--r--engine/battle/move_effects/mimic.asm52
-rw-r--r--engine/battle/move_effects/mirror_coat.asm61
-rw-r--r--engine/battle/move_effects/mirror_move.asm (renamed from engine/battle/effect_commands/mirror_move.asm)0
-rw-r--r--engine/battle/move_effects/mist.asm17
-rw-r--r--engine/battle/move_effects/nightmare.asm (renamed from engine/battle/effect_commands/nightmare.asm)0
-rw-r--r--engine/battle/move_effects/pain_split.asm97
-rw-r--r--engine/battle/move_effects/pay_day.asm28
-rw-r--r--engine/battle/move_effects/perish_song.asm (renamed from engine/battle/effect_commands/perish_song.asm)0
-rwxr-xr-xengine/battle/move_effects/present.asm (renamed from engine/battle/effect_commands/present.asm)11
-rw-r--r--engine/battle/move_effects/protect.asm (renamed from engine/battle/effect_commands/protect.asm)0
-rw-r--r--engine/battle/move_effects/psych_up.asm51
-rw-r--r--engine/battle/move_effects/pursuit.asm26
-rw-r--r--engine/battle/move_effects/rage.asm8
-rw-r--r--engine/battle/move_effects/rain_dance.asm11
-rw-r--r--engine/battle/move_effects/rapid_spin.asm38
-rw-r--r--engine/battle/move_effects/return.asm27
-rw-r--r--engine/battle/move_effects/rollout.asm (renamed from engine/battle/effect_commands/rollout.asm)0
-rw-r--r--engine/battle/move_effects/safeguard.asm25
-rw-r--r--engine/battle/move_effects/sandstorm.asm (renamed from engine/battle/effect_commands/sandstorm.asm)0
-rw-r--r--engine/battle/move_effects/selfdestruct.asm31
-rw-r--r--engine/battle/move_effects/sketch.asm119
-rw-r--r--engine/battle/move_effects/sleep_talk.asm145
-rw-r--r--engine/battle/move_effects/snore.asm13
-rw-r--r--engine/battle/move_effects/spikes.asm (renamed from engine/battle/effect_commands/spikes.asm)2
-rw-r--r--engine/battle/move_effects/spite.asm88
-rw-r--r--engine/battle/move_effects/splash.asm6
-rw-r--r--engine/battle/move_effects/substitute.asm90
-rw-r--r--engine/battle/move_effects/sunny_day.asm11
-rw-r--r--engine/battle/move_effects/teleport.asm91
-rw-r--r--engine/battle/move_effects/thief.asm (renamed from engine/battle/effect_commands/thief.asm)0
-rw-r--r--engine/battle/move_effects/thunder.asm20
-rwxr-xr-xengine/battle/move_effects/transform.asm (renamed from engine/battle/effect_commands/transform.asm)0
-rw-r--r--engine/battle/move_effects/triple_kick.asm39
-rwxr-xr-xengine/battle/read_trainer_party.asm3
-rw-r--r--engine/battle/returntobattle_useball.asm2
-rwxr-xr-xengine/battle/used_move_text.asm1
-rw-r--r--engine/battle_anims/anim_commands.asm2
-rwxr-xr-xengine/battle_anims/functions.asm5
-rwxr-xr-xengine/battle_anims/getpokeballwobble.asm30
-rwxr-xr-xengine/billspc.asm62
-rwxr-xr-xengine/billspctop.asm18
-rwxr-xr-xengine/breeding.asm18
-rwxr-xr-xengine/buy_sell_toss.asm22
-rw-r--r--engine/caught_data.asm4
-rw-r--r--engine/cgb_layouts.asm4
-rwxr-xr-xengine/clock_reset.asm2
-rw-r--r--engine/color.asm12
-rwxr-xr-xengine/crystal_intro.asm5
-rwxr-xr-xengine/debug.asm2
-rwxr-xr-xengine/decorations.asm60
-rwxr-xr-xengine/delete_save_change_clock.asm20
-rw-r--r--engine/events.asm6
-rwxr-xr-xengine/events/battle_tower/battle_tower.asm28
-rw-r--r--engine/events/battle_tower/get_trainer_class.asm4
-rw-r--r--engine/events/battle_tower/rules.asm2
-rw-r--r--engine/events/buena.asm42
-rw-r--r--engine/events/buena_menu.asm6
-rw-r--r--engine/events/bug_contest/contest.asm2
-rwxr-xr-xengine/events/bug_contest/contest_2.asm13
-rwxr-xr-xengine/events/bug_contest/judging.asm6
-rwxr-xr-xengine/events/celebi.asm8
-rwxr-xr-xengine/events/daycare.asm39
-rw-r--r--engine/events/dratini.asm2
-rwxr-xr-xengine/events/elevator.asm14
-rwxr-xr-xengine/events/field_moves.asm8
-rw-r--r--engine/events/fish.asm2
-rwxr-xr-xengine/events/forced_movement.asm8
-rw-r--r--engine/events/fruit_trees.asm4
-rwxr-xr-xengine/events/halloffame.asm6
-rwxr-xr-xengine/events/happiness_egg.asm16
-rwxr-xr-xengine/events/heal_machine_anim.asm4
-rw-r--r--engine/events/kurt.asm20
-rw-r--r--engine/events/loadfishinggfx.asm2
-rw-r--r--engine/events/lucky_number.asm4
-rw-r--r--engine/events/magikarp.asm33
-rwxr-xr-xengine/events/magnet_train.asm4
-rwxr-xr-xengine/events/misc_scripts.asm2
-rw-r--r--engine/events/mom.asm34
-rwxr-xr-xengine/events/mom_phone.asm4
-rw-r--r--engine/events/move_deleter.asm4
-rw-r--r--engine/events/move_tutor.asm8
-rw-r--r--engine/events/name_rater.asm2
-rwxr-xr-xengine/events/npc_trade.asm (renamed from engine/npctrade.asm)74
-rw-r--r--engine/events/odd_egg.asm4
-rwxr-xr-xengine/events/overworld.asm30
-rw-r--r--engine/events/poke_seer.asm2
-rwxr-xr-xengine/events/pokecenter_pc.asm84
-rwxr-xr-xengine/events/pokepic.asm10
-rw-r--r--engine/events/pokerus/check_pokerus.asm2
-rw-r--r--engine/events/pokerus/pokerus.asm15
-rwxr-xr-xengine/events/print_photo.asm2
-rw-r--r--engine/events/print_unown.asm2
-rw-r--r--engine/events/print_unown_2.asm4
-rwxr-xr-xengine/events/prof_oaks_pc.asm26
-rwxr-xr-xengine/events/sacred_ash.asm12
-rwxr-xr-xengine/events/special.asm42
-rw-r--r--engine/events/std_collision.asm2
-rw-r--r--engine/events/std_scripts.asm504
-rwxr-xr-xengine/events/sweet_scent.asm2
-rw-r--r--engine/events/unown_walls.asm30
-rwxr-xr-xengine/events/whiteout.asm6
-rw-r--r--engine/events_2.asm14
-rwxr-xr-xengine/evolution_animation.asm2
-rwxr-xr-xengine/init_gender.asm10
-rwxr-xr-xengine/intro_menu.asm38
-rw-r--r--engine/item_effects.asm22
-rwxr-xr-xengine/items.asm7
-rwxr-xr-xengine/learn.asm2
-rwxr-xr-xengine/link.asm53
-rwxr-xr-xengine/link_trade.asm4
-rwxr-xr-xengine/mail.asm24
-rwxr-xr-xengine/main_menu.asm18
-rw-r--r--engine/map_objects.asm38
-rw-r--r--engine/map_setup.asm12
-rwxr-xr-xengine/mart.asm48
-rwxr-xr-xengine/menu.asm42
-rw-r--r--engine/menu_2.asm28
-rwxr-xr-xengine/mon_menu.asm91
-rw-r--r--engine/mon_stats.asm2
-rwxr-xr-xengine/move_mon.asm2
-rw-r--r--engine/movement.asm2
-rwxr-xr-xengine/mystery_gift.asm6
-rwxr-xr-xengine/mystery_gift_2.asm4
-rwxr-xr-xengine/naming_screen.asm6
-rwxr-xr-xengine/npc_movement.asm2
-rwxr-xr-xengine/options_menu.asm2
-rwxr-xr-xengine/overworld.asm33
-rw-r--r--engine/pack.asm186
-rw-r--r--engine/party_menu.asm3
-rw-r--r--engine/phone/buenas_password.asm46
-rw-r--r--engine/phone/generic_calls.asm406
-rw-r--r--engine/phone/phone.asm16
-rw-r--r--engine/phone/phone_callers.asm296
-rw-r--r--engine/phone/phone_gossip.asm96
-rw-r--r--engine/phone/phone_scripts.asm352
-rw-r--r--engine/pic_animation.asm2
-rw-r--r--engine/player_gfx.asm26
-rwxr-xr-xengine/player_movement.asm6
-rwxr-xr-xengine/player_object.asm12
-rw-r--r--engine/pokedex/pokedex.asm2
-rwxr-xr-xengine/pokedex/unown_dex.asm2
-rwxr-xr-xengine/pokegear.asm44
-rw-r--r--engine/radio.asm22
-rw-r--r--engine/routines/playslowcry.asm2
-rwxr-xr-xengine/routines/sine.asm2
-rw-r--r--engine/routines/unreferenced_getgen1trainerclassname.asm2
-rw-r--r--engine/save.asm2
-rw-r--r--engine/scripting.asm64
-rwxr-xr-xengine/scrolling_menu.asm54
-rwxr-xr-xengine/search.asm8
-rwxr-xr-xengine/search2.asm8
-rwxr-xr-xengine/select_menu.asm2
-rwxr-xr-xengine/slot_machine.asm12
-rw-r--r--engine/specials.asm110
-rwxr-xr-xengine/sprites.asm23
-rwxr-xr-xengine/start_menu.asm169
-rwxr-xr-xengine/stats_screen.asm4
-rwxr-xr-xengine/switch_items.asm6
-rw-r--r--engine/tileset_anims.asm16
-rwxr-xr-xengine/time.asm18
-rwxr-xr-xengine/time_capsule.asm2
-rw-r--r--engine/time_capsule_2.asm2
-rw-r--r--engine/timeofdaypals.asm12
-rwxr-xr-xengine/timeset.asm12
-rw-r--r--engine/title.asm2
-rwxr-xr-xengine/trainer_card.asm2
-rwxr-xr-xengine/unown_puzzle.asm2
-rwxr-xr-xengine/warp_connection.asm6
-rwxr-xr-xengine/wildmons.asm12
202 files changed, 4631 insertions, 5014 deletions
diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm
index b5ac966f8..dd4357fe2 100755
--- a/engine/battle/ai/move.asm
+++ b/engine/battle/ai/move.asm
@@ -202,6 +202,7 @@ AIChooseMove: ; 440ce
AIScoringPointers: ; 441af
+; entries correspond to AI_* constants
dw AI_Basic
dw AI_Setup
dw AI_Types
diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm
index b250128a4..7af2db8ad 100644
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -40,7 +40,7 @@ AI_Basic: ; 38591
push hl
push de
push bc
- ld hl, .statusonlyeffects
+ ld hl, StatusOnlyEffects
ld de, 1
call IsInArray
@@ -63,13 +63,7 @@ AI_Basic: ; 38591
jr .checkmove
; 385db
-.statusonlyeffects
- db EFFECT_SLEEP
- db EFFECT_TOXIC
- db EFFECT_POISON
- db EFFECT_PARALYZE
- db -1 ; end
-; 385e0
+INCLUDE "data/battle/ai/status_only_effects.asm"
@@ -1502,7 +1496,7 @@ AI_Smart_Encore: ; 38c3b
.asm_38c68
push hl
ld a, [wLastPlayerCounterMove]
- ld hl, .EncoreMoves
+ ld hl, EncoreMoves
ld de, 1
call IsInArray
pop hl
@@ -1522,39 +1516,7 @@ AI_Smart_Encore: ; 38c3b
inc [hl]
ret
-.EncoreMoves:
- db SWORDS_DANCE
- db WHIRLWIND
- db LEER
- db ROAR
- db DISABLE
- db MIST
- db LEECH_SEED
- db GROWTH
- db POISONPOWDER
- db STRING_SHOT
- db MEDITATE
- db AGILITY
- db TELEPORT
- db SCREECH
- db HAZE
- db FOCUS_ENERGY
- db DREAM_EATER
- db POISON_GAS
- db SPLASH
- db SHARPEN
- db CONVERSION
- db SUPER_FANG
- db SUBSTITUTE
- db TRIPLE_KICK
- db SPIDER_WEB
- db MIND_READER
- db FLAME_WHEEL
- db AEROBLAST
- db COTTON_SPORE
- db POWDER_SNOW
- db -1 ; end
-; 38ca4
+INCLUDE "data/battle/ai/encore_moves.asm"
AI_Smart_PainSplit: ; 38ca4
@@ -2521,20 +2483,7 @@ AI_Smart_RainDance: ; 390cb
jr AI_Smart_WeatherMove
; 390e7
-RainDanceMoves: ; 390e7
- db WATER_GUN
- db HYDRO_PUMP
- db SURF
- db BUBBLEBEAM
- db THUNDER
- db WATERFALL
- db CLAMP
- db BUBBLE
- db CRABHAMMER
- db OCTAZOOKA
- db WHIRLPOOL
- db -1 ; end
-; 390f3
+INCLUDE "data/battle/ai/rain_dance_moves.asm"
AI_Smart_SunnyDay: ; 390f3
@@ -2613,17 +2562,7 @@ AIGoodWeatherType: ; 39122
; 39134
-SunnyDayMoves: ; 39134
- db FIRE_PUNCH
- db EMBER
- db FLAMETHROWER
- db FIRE_SPIN
- db FIRE_BLAST
- db SACRED_FIRE
- db MORNING_SUN
- db SYNTHESIS
- db -1 ; end
-; 3913d
+INCLUDE "data/battle/ai/sunny_day_moves.asm"
AI_Smart_BellyDrum: ; 3913d
@@ -3104,29 +3043,7 @@ AIHasMoveInArray: ; 392e6
; 39301
-UsefulMoves: ; 39301
-; Moves that are usable all-around.
- db DOUBLE_EDGE
- db SING
- db FLAMETHROWER
- db HYDRO_PUMP
- db SURF
- db ICE_BEAM
- db BLIZZARD
- db HYPER_BEAM
- db SLEEP_POWDER
- db THUNDERBOLT
- db THUNDER
- db EARTHQUAKE
- db TOXIC
- db PSYCHIC_M
- db HYPNOSIS
- db RECOVER
- db FIRE_BLAST
- db SOFTBOILED
- db SUPER_FANG
- db -1 ; end
-; 39315
+INCLUDE "data/battle/ai/useful_moves.asm"
AI_Opportunist: ; 39315
@@ -3161,7 +3078,7 @@ AI_Opportunist: ; 39315
push hl
push de
push bc
- ld hl, .stallmoves
+ ld hl, StallMoves
ld de, 1
call IsInArray
@@ -3176,41 +3093,7 @@ AI_Opportunist: ; 39315
.asm_39347
ret
-.stallmoves
- db SWORDS_DANCE
- db TAIL_WHIP
- db LEER
- db GROWL
- db DISABLE
- db MIST
- db COUNTER
- db LEECH_SEED
- db GROWTH
- db STRING_SHOT
- db MEDITATE
- db AGILITY
- db RAGE
- db MIMIC
- db SCREECH
- db HARDEN
- db WITHDRAW
- db DEFENSE_CURL
- db BARRIER
- db LIGHT_SCREEN
- db HAZE
- db REFLECT
- db FOCUS_ENERGY
- db BIDE
- db AMNESIA
- db TRANSFORM
- db SPLASH
- db ACID_ARMOR
- db SHARPEN
- db CONVERSION
- db SUBSTITUTE
- db FLAME_WHEEL
- db -1 ; end
-; 39369
+INCLUDE "data/battle/ai/stall_moves.asm"
@@ -3304,7 +3187,7 @@ AI_Aggressive: ; 39369
push de
push bc
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
- ld hl, .RecklessMoves
+ ld hl, RecklessMoves
ld de, 1
call IsInArray
pop bc
@@ -3319,13 +3202,7 @@ AI_Aggressive: ; 39369
.done
ret
-.RecklessMoves:
- db EFFECT_SELFDESTRUCT
- db EFFECT_RAMPAGE
- db EFFECT_MULTI_HIT
- db EFFECT_DOUBLE_HIT
- db -1 ; end
-; 393e7
+INCLUDE "data/battle/ai/reckless_moves.asm"
AIDamageCalc: ; 393e7
@@ -3333,7 +3210,7 @@ AIDamageCalc: ; 393e7
ld [hBattleTurn], a
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
ld de, 1
- ld hl, .ConstantDamageEffects
+ ld hl, ConstantDamageEffects
call IsInArray
jr nc, .asm_39400
callfar BattleCommand_ConstantDamage
@@ -3345,13 +3222,7 @@ AIDamageCalc: ; 393e7
callfar BattleCommand_Stab
ret
-.ConstantDamageEffects:
- db EFFECT_SUPER_FANG
- db EFFECT_STATIC_DAMAGE
- db EFFECT_LEVEL_DAMAGE
- db EFFECT_PSYWAVE
- db -1 ; end
-; 39418
+INCLUDE "data/battle/ai/constant_damage_effects.asm"
AI_Cautious: ; 39418
@@ -3377,7 +3248,7 @@ AI_Cautious: ; 39418
push hl
push de
push bc
- ld hl, .residualmoves
+ ld hl, ResidualMoves
ld de, 1
call IsInArray
@@ -3393,21 +3264,7 @@ AI_Cautious: ; 39418
inc [hl]
jr .asm_39425
-.residualmoves
- db MIST
- db LEECH_SEED
- db POISONPOWDER
- db STUN_SPORE
- db THUNDER_WAVE
- db FOCUS_ENERGY
- db BIDE
- db POISON_GAS
- db TRANSFORM
- db CONVERSION
- db SUBSTITUTE
- db SPIKES
- db -1 ; end
-; 39453
+INCLUDE "data/battle/ai/residual_moves.asm"
@@ -3504,7 +3361,7 @@ AI_Risky: ; 394a9
; Don't use risky moves at max hp.
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
ld de, 1
- ld hl, .RiskyMoves
+ ld hl, RiskyEffects
call IsInArray
jr nc, .checkko
@@ -3541,11 +3398,7 @@ endr
pop de
jr .checkmove
-.RiskyMoves:
- db EFFECT_SELFDESTRUCT
- db EFFECT_OHKO
- db -1 ; end
-; 39502
+INCLUDE "data/battle/ai/risky_effects.asm"
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index 29b2d8663..e331cf3ee 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -789,7 +789,7 @@ StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7)
; 8c728 (23:4728)
.sinewave ; 8c728
- sine_wave $100
+ sine_wave 32
; 8c768
StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
diff --git a/engine/battle/consumehelditem.asm b/engine/battle/consumehelditem.asm
index 39ddbc27e..d727a44e0 100644
--- a/engine/battle/consumehelditem.asm
+++ b/engine/battle/consumehelditem.asm
@@ -18,7 +18,7 @@ ConsumeHeldItem: ; 27192
ld a, [de]
ld b, a
farcall GetItemHeldEffect
- ld hl, .ConsumableEffects
+ ld hl, ConsumableEffects
.loop
ld a, [hli]
cp b
@@ -46,7 +46,7 @@ ConsumeHeldItem: ; 27192
jr z, .done
.ourturn
- ld [hl], $0
+ ld [hl], NO_ITEM
.done
pop bc
@@ -54,27 +54,4 @@ ConsumeHeldItem: ; 27192
pop hl
ret
-.ConsumableEffects: ; 271de
-; Consumable items?
- db HELD_BERRY
- db HELD_2
- db HELD_5
- db HELD_HEAL_POISON
- db HELD_HEAL_FREEZE
- db HELD_HEAL_BURN
- db HELD_HEAL_SLEEP
- db HELD_HEAL_PARALYZE
- db HELD_HEAL_STATUS
- db HELD_30
- db HELD_ATTACK_UP
- db HELD_DEFENSE_UP
- db HELD_SPEED_UP
- db HELD_SP_ATTACK_UP
- db HELD_SP_DEFENSE_UP
- db HELD_ACCURACY_UP
- db HELD_EVASION_UP
- db HELD_38
- db HELD_71
- db HELD_ESCAPE
- db HELD_CRITICAL_UP
- db -1
+INCLUDE "data/battle/held_consumables.asm"
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 0fe77df40..11016b8af 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1807,10 +1807,13 @@ HandleWeather: ; 3cb9e
; 3cc2d
.WeatherMessages:
+; entries correspond to WEATHER_* constants
dw BattleText_RainContinuesToFall
dw BattleText_TheSunlightIsStrong
dw BattleText_TheSandstormRages
+
.WeatherEndedMessages:
+; entries correspond to WEATHER_* constants
dw BattleText_TheRainStopped
dw BattleText_TheSunlightFaded
dw BattleText_TheSandstormSubsided
@@ -2471,22 +2474,22 @@ WinTrainerBattle: ; 3cfa4
call nz, .DoubleReward
call .CheckMaxedOutMomMoney
push af
- ld a, $0
+ ld a, FALSE
jr nc, .okay
ld a, [wMomSavingMoney]
- and $7
- cp $3
+ and MOM_SAVING_MONEY_MASK
+ cp (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F)
jr nz, .okay
- inc a
+ inc a ; TRUE
.okay
ld b, a
- ld c, $4
+ ld c, 4
.loop
ld a, b
and a
jr z, .loop2
- call .SendMoneyToMom
+ call .AddMoneyToMom
dec c
dec b
jr .loop
@@ -2505,7 +2508,7 @@ WinTrainerBattle: ; 3cfa4
pop af
jr nc, .KeepItAll
ld a, [wMomSavingMoney]
- and $7
+ and MOM_SAVING_MONEY_MASK
jr z, .KeepItAll
ld hl, .SentToMomTexts
dec a
@@ -2523,7 +2526,7 @@ WinTrainerBattle: ; 3cfa4
jp StdBattleTextBox
; 3d081
-.SendMoneyToMom: ; 3d081
+.AddMoneyToMom: ; 3d081
push bc
ld hl, wBattleReward + 2
ld de, wMomsMoney + 2
@@ -2557,6 +2560,7 @@ WinTrainerBattle: ; 3cfa4
; 3d0ab
.SentToMomTexts: ; 3d0ab
+; entries correspond to MOM_SAVING_* constants
dw SentSomeToMomText
dw SentHalfToMomText
dw SentAllToMomText
@@ -2574,7 +2578,7 @@ WinTrainerBattle: ; 3cfa4
; 3d0be
AddBattleMoneyToAccount: ; 3d0be
- ld c, $3
+ ld c, 3
and a
push de
push hl
@@ -2653,7 +2657,7 @@ IsGymLeader: ; 0x3d128
IsGymLeaderCommon:
push de
ld a, [wOtherTrainerClass]
- ld de, $1
+ ld de, 1
call IsInArray
pop de
ret
@@ -2781,7 +2785,7 @@ AskUseNextPokemon: ; 3d1f8
ForcePlayerMonChoice: ; 3d227
call EmptyBattleTextBox
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call SetUpBattlePartyMenu_NoLoop
call ForcePickPartyMonInBattle
ld a, [wLinkMode]
@@ -3300,7 +3304,7 @@ ResetEnemyBattleVars: ; 3d557
ld a, 8
call SlideBattlePicOut
call EmptyBattleTextBox
- jp LoadStandardMenuDataHeader
+ jp LoadStandardMenuHeader
; 3d57a
ResetBattleParticipants: ; 3d57a
@@ -4488,7 +4492,7 @@ ItemRecoveryAnim: ; 3ddc8
UseHeldStatusHealingItem: ; 3dde9
callfar GetOpponentItem
- ld hl, .Statuses
+ ld hl, HeldStatusHealingEffects
.loop
ld a, [hli]
cp $ff
@@ -4541,15 +4545,7 @@ UseHeldStatusHealingItem: ; 3dde9
ret
; 3de44
-.Statuses: ; 3de44
- db HELD_HEAL_POISON, 1 << PSN
- db HELD_HEAL_FREEZE, 1 << FRZ
- db HELD_HEAL_BURN, 1 << BRN
- db HELD_HEAL_SLEEP, SLP
- db HELD_HEAL_PARALYZE, 1 << PAR
- db HELD_HEAL_STATUS, ALL_STATUS
- db -1 ; end
-; 3de51
+INCLUDE "data/battle/held_heal_status.asm"
UseConfusionHealingItem: ; 3de51
ld a, BATTLE_VARS_SUBSTATUS3_OPP
@@ -4624,10 +4620,10 @@ HandleStatBoostingHeldItems: ; 3de97
ld a, [bc]
ld b, a
callfar GetItemHeldEffect
- ld hl, .StatUpItems
+ ld hl, HeldStatUpItems
.loop
ld a, [hli]
- cp $ff
+ cp -1
jr z, .finish
inc hl
inc hl
@@ -4664,16 +4660,7 @@ HandleStatBoostingHeldItems: ; 3de97
ret
; 3defc
-.StatUpItems:
- dbw HELD_ATTACK_UP, BattleCommand_AttackUp
- dbw HELD_DEFENSE_UP, BattleCommand_DefenseUp
- dbw HELD_SPEED_UP, BattleCommand_SpeedUp
- dbw HELD_SP_ATTACK_UP, BattleCommand_SpecialAttackUp
- dbw HELD_SP_DEFENSE_UP, BattleCommand_SpecialDefenseUp
- dbw HELD_ACCURACY_UP, BattleCommand_AccuracyUp
- dbw HELD_EVASION_UP, BattleCommand_EvasionUp
- db -1 ; end
-; 3df12
+INCLUDE "data/battle/held_stat_up.asm"
GetPartymonItem: ; 3df12
ld hl, wPartyMon1Item
@@ -5107,7 +5094,7 @@ BattleMenu_Pack: ; 3e1c7
and a
jp nz, .ItemsCantBeUsed
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
@@ -5202,10 +5189,10 @@ BattleMenu_Pack: ; 3e1c7
; 3e28d
BattleMenu_PKMN: ; 3e28d
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
BattleMenuPKMN_ReturnFromStats:
call ExitMenu
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearBGPalettes
BattleMenuPKMN_Loop:
call SetUpBattlePartyMenu
@@ -5345,7 +5332,7 @@ PlayerSwitch: ; 3e3ad
ld a, [wLinkMode]
and a
jr z, .not_linked
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call LinkBattleSendReceiveAction
call CloseWindow
@@ -6642,7 +6629,7 @@ CheckUnownLetter: ; 3eb75
jr nc, .next
; Is our letter in the set?
- ld hl, .LetterSets
+ ld hl, UnlockedUnownLetterSets
add hl, de
ld a, [hli]
ld h, [hl]
@@ -6663,7 +6650,7 @@ CheckUnownLetter: ; 3eb75
inc e
inc e
ld a, e
- cp .Set1 - .LetterSets
+ cp UnlockedUnownLetterSets.End - UnlockedUnownLetterSets
jr c, .loop
; Hasn't been unlocked, or the letter is invalid
@@ -6675,26 +6662,8 @@ CheckUnownLetter: ; 3eb75
and a
ret
-.LetterSets:
- dw .Set1
- dw .Set2
- dw .Set3
- dw .Set4
-
-.Set1:
- ; A B C D E F G H I J K
- db 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, $ff
-.Set2:
- ; L M N O P Q R
- db 12, 13, 14, 15, 16, 17, 18, $ff
-.Set3:
- ; S T U V W
- db 19, 20, 21, 22, 23, $ff
-.Set4:
- ; X Y Z
- db 24, 25, 26, $ff
+INCLUDE "data/wild/unlocked_unowns.asm"
-; 3ebc7
Unreferenced_SwapBattlerLevels: ; 3ebc7
push bc
@@ -6920,7 +6889,7 @@ ApplyStatLevelMultiplier: ; 3ecb7
.okay2
pop bc
push hl
- ld hl, .StatLevelMultipliers
+ ld hl, StatLevelMultipliers_Applied
dec b
sla b
ld c, b
@@ -6969,24 +6938,7 @@ ApplyStatLevelMultiplier: ; 3ecb7
ret
; 3ed2b
-.StatLevelMultipliers:
-; /
- db 25, 100 ; 25%
- db 28, 100 ; 28%
- db 33, 100 ; 33%
- db 40, 100 ; 40%
- db 50, 100 ; 50%
- db 66, 100 ; 66%
-
- db 1, 1 ; 100%
-
- db 15, 10 ; 150%
- db 2, 1 ; 200%
- db 25, 10 ; 250%
- db 3, 1 ; 300%
- db 35, 10 ; 350%
- db 4, 1 ; 400%
-; 3ed45
+INCLUDE "data/battle/stat_multipliers_2.asm"
BadgeStatBoosts: ; 3ed45
; Raise the stats of the battle mon in wBattleMon
@@ -8728,7 +8680,7 @@ IsMobileBattle2: ; 3f830
ret
; 3f836
-DisplayLinkRecord: ; 3f836
+_DisplayLinkRecord: ; 3f836
ld a, BANK(sLinkBattleStats)
call GetSRAMBank
@@ -9282,10 +9234,10 @@ GetTrainerBackpic: ; 3fbff
; What gender are we?
ld a, [wPlayerSpriteSetupFlags]
- bit 2, a ; transformed to male
+ bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .Chris
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .Chris
; It's a girl.
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 48efba8fa..e19bdaacc 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -1306,45 +1306,7 @@ INCLUDE "data/battle/critical_hits.asm"
; 346b2
-BattleCommand_TripleKick: ; 346b2
-; triplekick
-
- ld a, [wKickCounter]
- ld b, a
- inc b
- ld hl, wCurDamage + 1
- ld a, [hld]
- ld e, a
- ld a, [hli]
- ld d, a
-.next_kick
- dec b
- ret z
- ld a, [hl]
- add e
- ld [hld], a
- ld a, [hl]
- adc d
- ld [hli], a
-
-; No overflow.
- jr nc, .next_kick
- ld a, $ff
- ld [hld], a
- ld [hl], a
- ret
-
-; 346cd
-
-
-BattleCommand_KickCounter: ; 346cd
-; kickcounter
-
- ld hl, wKickCounter
- inc [hl]
- ret
-
-; 346d2
+INCLUDE "engine/battle/move_effects/triple_kick.asm"
BattleCommand_Stab: ; 346d2
@@ -1637,9 +1599,11 @@ BattleCommand_ResetTypeMatchup: ; 34833
; 3484e
+
INCLUDE "engine/battle/ai/switch.asm"
-INCLUDE "data/battle/type_matchups.asm"
+INCLUDE "data/types/type_matchups.asm"
+
BattleCommand_DamageVariation: ; 34cfd
; damagevariation
@@ -2144,20 +2108,19 @@ BattleCommand_HitTargetNoSub: ; 34f60
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
cp EFFECT_MULTI_HIT
- jr z, .multihit
+ jr z, .alternate_anim
cp EFFECT_CONVERSION
- jr z, .conversion
+ jr z, .alternate_anim
cp EFFECT_DOUBLE_HIT
- jr z, .doublehit
+ jr z, .alternate_anim
cp EFFECT_POISON_MULTI_HIT
- jr z, .twineedle
+ jr z, .alternate_anim
cp EFFECT_TRIPLE_KICK
jr z, .triplekick
xor a
ld [wKickCounter], a
.triplekick
-
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld e, a
@@ -2167,18 +2130,13 @@ BattleCommand_HitTargetNoSub: ; 34f60
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
cp FLY
- jr z, .fly_dig
+ jr z, .clear_sprite
cp DIG
ret nz
-
-.fly_dig
-; clear sprite
+.clear_sprite
jp AppearUserLowerSub
-.multihit
-.conversion
-.doublehit
-.twineedle
+.alternate_anim
ld a, [wKickCounter]
and 1
xor 1
@@ -2713,7 +2671,7 @@ BattleCommand_RageDamage: ; 3527b
dec a
add hl, bc
jr nc, .rage_loop
- ld hl, -1
+ ld hl, $ffff
.done
ld a, h
ld [wCurDamage], a
@@ -3136,225 +3094,7 @@ EnemyAttackDamage: ; 353f6
; 35461
-BattleCommand_BeatUp: ; 35461
-; beatup
-
- call ResetDamage
- ld a, [hBattleTurn]
- and a
- jp nz, .enemy_beats_up
- ld a, [wPlayerSubStatus3]
- bit SUBSTATUS_IN_LOOP, a
- jr nz, .next_mon
- ld c, 20
- call DelayFrames
- xor a
- ld [wPlayerRolloutCount], a
- ld [wd002], a
- ld [wBeatUpHitAtLeastOnce], a
- jr .got_mon
-
-.next_mon
- ld a, [wPlayerRolloutCount]
- ld b, a
- ld a, [wPartyCount]
- sub b
- ld [wd002], a
-
-.got_mon
- ld a, [wd002]
- ld hl, wPartyMonNicknames
- call GetNick
- ld a, MON_HP
- call GetBeatupMonLocation
- ld a, [hli]
- or [hl]
- jp z, .beatup_fail ; fainted
- ld a, [wd002]
- ld c, a
- ld a, [wCurBattleMon]
- ; BUG: this can desynchronize link battles
- ; Change "cp [hl]" to "cp c" to fix
- cp [hl]
- ld hl, wBattleMonStatus
- jr z, .active_mon
- ld a, MON_STATUS
- call GetBeatupMonLocation
-.active_mon
- ld a, [hl]
- and a
- jp nz, .beatup_fail
-
- ld a, $1
- ld [wBeatUpHitAtLeastOnce], a
- ld hl, BeatUpAttackText
- call StdBattleTextBox
- ld a, [wEnemyMonSpecies]
- ld [wCurSpecies], a
- call GetBaseData
- ld a, [wBaseDefense]
- ld c, a
- push bc
- ld a, MON_SPECIES
- call GetBeatupMonLocation
- ld a, [hl]
- ld [wCurSpecies], a
- call GetBaseData
- ld a, [wBaseAttack]
- pop bc
- ld b, a
- push bc
- ld a, MON_LEVEL
- call GetBeatupMonLocation
- ld a, [hl]
- ld e, a
- pop bc
- ld a, [wPlayerMoveStructPower]
- ld d, a
- ret
-
-.enemy_beats_up
- ld a, [wEnemySubStatus3]
- bit SUBSTATUS_IN_LOOP, a
- jr nz, .not_first_enemy_beatup
-
- xor a
- ld [wEnemyRolloutCount], a
- ld [wd002], a
- ld [wBeatUpHitAtLeastOnce], a
- jr .enemy_continue
-
-.not_first_enemy_beatup
- ld a, [wEnemyRolloutCount]
- ld b, a
- ld a, [wOTPartyCount]
- sub b
- ld [wd002], a
-.enemy_continue
- ld a, [wBattleMode]
- dec a
- jr z, .wild
-
- ld a, [wLinkMode]
- and a
- jr nz, .link_or_tower
-
- ld a, [wInBattleTowerBattle]
- and a
- jr nz, .link_or_tower
-
- ld a, [wd002]
- ld c, a
- ld b, 0
- ld hl, wOTPartySpecies
- add hl, bc
- ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
- call GetPokemonName
- jr .got_enemy_nick
-
-.link_or_tower
- ld a, [wd002]
- ld hl, wOTPartyMonNicknames
- ld bc, NAME_LENGTH
- call AddNTimes
- ld de, wStringBuffer1
- call CopyBytes
-.got_enemy_nick
- ld a, MON_HP
- call GetBeatupMonLocation
- ld a, [hli]
- or [hl]
- jp z, .beatup_fail
- ld a, [wd002]
- ld b, a
- ld a, [wCurOTMon]
- cp b
- ld hl, wEnemyMonStatus
- jr z, .active_enemy
-
- ld a, MON_STATUS
- call GetBeatupMonLocation
-.active_enemy
- ld a, [hl]
- and a
- jr nz, .beatup_fail
-
- ld a, $1
- ld [wBeatUpHitAtLeastOnce], a
- jr .finish_beatup
-
-.wild
- ld a, [wEnemyMonSpecies]
- ld [wNamedObjectIndexBuffer], a
- call GetPokemonName
- ld hl, BeatUpAttackText
- call StdBattleTextBox
- jp EnemyAttackDamage
-
-.finish_beatup
- ld hl, BeatUpAttackText
- call StdBattleTextBox
- ld a, [wBattleMonSpecies]
- ld [wCurSpecies], a
- call GetBaseData
- ld a, [wBaseDefense]
- ld c, a
- push bc
- ld a, MON_SPECIES
- call GetBeatupMonLocation
- ld a, [hl]
- ld [wCurSpecies], a
- call GetBaseData
- ld a, [wBaseAttack]
- pop bc
- ld b, a
- push bc
- ld a, MON_LEVEL
- call GetBeatupMonLocation
- ld a, [hl]
- ld e, a
- pop bc
- ld a, [wEnemyMoveStructPower]
- ld d, a
- ret
-
-; 355b0
-
-
-.beatup_fail ; 355b0
- ld b, buildopponentrage_command
- jp SkipToBattleCommand
-
-; 355b5
-
-
-BattleCommanda8: ; 355b5
- ld a, [wBeatUpHitAtLeastOnce]
- and a
- ret nz
-
- jp PrintButItFailed
-
-; 355bd
-
-
-GetBeatupMonLocation: ; 355bd
- push bc
- ld c, a
- ld b, 0
- ld a, [hBattleTurn]
- and a
- ld hl, wPartyMon1Species
- jr z, .got_species
- ld hl, wOTPartyMon1Species
-
-.got_species
- ld a, [wd002]
- add hl, bc
- call GetPartyLocation
- pop bc
- ret
+INCLUDE "engine/battle/move_effects/beat_up.asm"
BattleCommand_ClearMissDamage: ; 355d5
@@ -3642,7 +3382,7 @@ BattleCommand_DamageCalc: ; 35612
; 35703
-INCLUDE "data/battle/type_boost_items.asm"
+INCLUDE "data/types/type_boost_items.asm"
BattleCommand_ConstantDamage: ; 35726
@@ -3691,7 +3431,7 @@ BattleCommand_ConstantDamage: ; 35726
cp b
jr nc, .psywave_loop
ld b, a
- ld a, $0
+ ld a, 0
jr .got_power
.super_fang
@@ -3712,9 +3452,9 @@ BattleCommand_ConstantDamage: ; 35726
and a
jr nz, .got_power
or b
- ld a, $0
+ ld a, 0
jr nz, .got_power
- ld b, $1
+ ld b, 1
jr .got_power
.got_power
@@ -3766,11 +3506,11 @@ BattleCommand_ConstantDamage: ; 35726
ld [hDividend + 2], a
.skip_to_divide
- ld b, $4
+ ld b, 4
call Divide
ld a, [hQuotient + 2]
ld b, a
- ld hl, .FlailPower
+ ld hl, FlailReversalPower
.reversal_loop
ld a, [hli]
@@ -3803,529 +3543,22 @@ BattleCommand_ConstantDamage: ; 35726
ld [hl], 1
ret
-.FlailPower:
- ; px, bp
- db 1, 200
- db 4, 150
- db 9, 100
- db 16, 80
- db 32, 40
- db 48, 20
-; 35813
-
-
-BattleCommand_Counter: ; 35813
-; counter
-
- ld a, 1
- ld [wAttackMissed], a
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- ret z
-
- ld b, a
- callfar GetMoveEffect
- ld a, b
- cp EFFECT_COUNTER
- ret z
-
- call BattleCommand_ResetTypeMatchup
- ld a, [wTypeMatchup]
- and a
- ret z
-
- call CheckOpponentWentFirst
- ret z
-
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- dec a
- ld de, wStringBuffer1
- call GetMoveData
-
- ld a, [wStringBuffer1 + MOVE_POWER]
- and a
- ret z
-
- ld a, [wStringBuffer1 + MOVE_TYPE]
- cp SPECIAL
- ret nc
-
- ld hl, wCurDamage
- ld a, [hli]
- or [hl]
- ret z
-
- ld a, [hl]
- add a
- ld [hld], a
- ld a, [hl]
- adc a
- ld [hl], a
- jr nc, .capped
- ld a, $ff
- ld [hli], a
- ld [hl], a
-.capped
-
- xor a
- ld [wAttackMissed], a
- ret
-
-; 35864
-
-
-BattleCommand_Encore: ; 35864
-; encore
-
- ld hl, wEnemyMonMoves
- ld de, wEnemyEncoreCount
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld hl, wBattleMonMoves
- ld de, wPlayerEncoreCount
-.ok
- ld a, BATTLE_VARS_LAST_MOVE_OPP
- call GetBattleVar
- and a
- jp z, .failed
- cp STRUGGLE
- jp z, .failed
- cp ENCORE
- jp z, .failed
- cp MIRROR_MOVE
- jp z, .failed
- ld b, a
-
-.got_move
- ld a, [hli]
- cp b
- jr nz, .got_move
-
- ld bc, wBattleMonPP - wBattleMonMoves - 1
- add hl, bc
- ld a, [hl]
- and PP_MASK
- jp z, .failed
- ld a, [wAttackMissed]
- and a
- jp nz, .failed
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVarAddr
- bit SUBSTATUS_ENCORED, [hl]
- jp nz, .failed
- set SUBSTATUS_ENCORED, [hl]
- call BattleRandom
- and $3
- inc a
- inc a
- inc a
- ld [de], a
- call CheckOpponentWentFirst
- jr nz, .finish_move
- ld a, [hBattleTurn]
- and a
- jr z, .force_last_enemy_move
-
- push hl
- ld a, [wLastPlayerMove]
- ld b, a
- ld c, 0
- ld hl, wBattleMonMoves
-.find_player_move
- ld a, [hli]
- cp b
- jr z, .got_player_move
- inc c
- ld a, c
- cp NUM_MOVES
- jr c, .find_player_move
- pop hl
- res SUBSTATUS_ENCORED, [hl]
- xor a
- ld [de], a
- jr .failed
-
-.got_player_move
- pop hl
- ld a, c
- ld [wCurMoveNum], a
- ld a, b
- ld [wCurPlayerMove], a
- dec a
- ld de, wPlayerMoveStruct
- call GetMoveData
- jr .finish_move
-
-.force_last_enemy_move
- push hl
- ld a, [wLastEnemyMove]
- ld b, a
- ld c, 0
- ld hl, wEnemyMonMoves
-.find_enemy_move
- ld a, [hli]
- cp b
- jr z, .got_enemy_move
- inc c
- ld a, c
- cp NUM_MOVES
- jr c, .find_enemy_move
- pop hl
- res SUBSTATUS_ENCORED, [hl]
- xor a
- ld [de], a
- jr .failed
-
-.got_enemy_move
- pop hl
- ld a, c
- ld [wCurEnemyMoveNum], a
- ld a, b
- ld [wCurEnemyMove], a
- dec a
- ld de, wEnemyMoveStruct
- call GetMoveData
-
-.finish_move
- call AnimateCurrentMove
- ld hl, GotAnEncoreText
- jp StdBattleTextBox
-
-.failed
- jp PrintDidntAffect2
-
-; 35926
-
-
-BattleCommand_PainSplit: ; 35926
-; painsplit
-
- ld a, [wAttackMissed]
- and a
- jp nz, .ButItFailed
- call CheckSubstituteOpp
- jp nz, .ButItFailed
- call AnimateCurrentMove
- ld hl, wBattleMonMaxHP + 1
- ld de, wEnemyMonMaxHP + 1
- call .PlayerShareHP
- ld a, $1
- ld [wWhichHPBar], a
- hlcoord 10, 9
- predef AnimateHPBar
- ld hl, wEnemyMonHP
- ld a, [hli]
- ld [wBuffer4], a
- ld a, [hli]
- ld [wBuffer3], a
- ld a, [hli]
- ld [wBuffer2], a
- ld a, [hl]
- ld [wBuffer1], a
- call .EnemyShareHP
- xor a
- ld [wWhichHPBar], a
- call ResetDamage
- hlcoord 2, 2
- predef AnimateHPBar
- farcall _UpdateBattleHUDs
-
- ld hl, SharedPainText
- jp StdBattleTextBox
-
-.PlayerShareHP:
- ld a, [hld]
- ld [wBuffer1], a
- ld a, [hld]
- ld [wBuffer2], a
- ld a, [hld]
- ld b, a
- ld [wBuffer3], a
- ld a, [hl]
- ld [wBuffer4], a
- dec de
- dec de
- ld a, [de]
- dec de
- add b
- ld [wCurDamage + 1], a
- ld b, [hl]
- ld a, [de]
- adc b
- srl a
- ld [wCurDamage], a
- ld a, [wCurDamage + 1]
- rr a
- ld [wCurDamage + 1], a
- inc hl
- inc hl
- inc hl
- inc de
- inc de
- inc de
-
-.EnemyShareHP: ; 359ac
- ld c, [hl]
- dec hl
- ld a, [wCurDamage + 1]
- sub c
- ld b, [hl]
- dec hl
- ld a, [wCurDamage]
- sbc b
- jr nc, .skip
-
- ld a, [wCurDamage]
- ld b, a
- ld a, [wCurDamage + 1]
- ld c, a
-.skip
- ld a, c
- ld [hld], a
- ld [wBuffer5], a
- ld a, b
- ld [hli], a
- ld [wBuffer6], a
- ret
-
-; 359cd
-
-.ButItFailed:
- jp PrintDidntAffect2
-
-; 359d0
-
-
-BattleCommand_Snore: ; 359d0
-; snore
- ld a, BATTLE_VARS_STATUS
- call GetBattleVar
- and SLP
- ret nz
- call ResetDamage
- ld a, $1
- ld [wAttackMissed], a
- call FailSnore
- jp EndMoveEffect
-
-; 359e6
-
-
-BattleCommand_Conversion2: ; 359e6
-; conversion2
-
- ld a, [wAttackMissed]
- and a
- jr nz, .failed
- ld hl, wBattleMonType1
- ld a, [hBattleTurn]
- and a
- jr z, .got_type
- ld hl, wEnemyMonType1
-.got_type
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- jr z, .failed
- push hl
- dec a
- ld hl, Moves + MOVE_TYPE
- call GetMoveAttr
- ld d, a
- pop hl
- cp CURSE_T
- jr z, .failed
- call AnimateCurrentMove
- call BattleCommand_SwitchTurn
-
-.loop
- call BattleRandom
- and $1f
- cp UNUSED_TYPES
- jr c, .okay
- cp UNUSED_TYPES_END
- jr c, .loop
- cp TYPES_END
- jr nc, .loop
-.okay
- ld [hli], a
- ld [hld], a
- push hl
- ld a, BATTLE_VARS_MOVE_TYPE
- call GetBattleVarAddr
- push af
- push hl
- ld a, d
- ld [hl], a
- call BattleCheckTypeMatchup
- pop hl
- pop af
- ld [hl], a
- pop hl
- ld a, [wTypeMatchup]
- cp 10
- jr nc, .loop
- call BattleCommand_SwitchTurn
-
- ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
- predef GetTypeName
- ld hl, TransformedTypeText
- jp StdBattleTextBox
-
-.failed
- jp FailConversion2
-
-; 35a53
-
-
-BattleCommand_LockOn: ; 35a53
-; lockon
-
- call CheckSubstituteOpp
- jr nz, .fail
-
- ld a, [wAttackMissed]
- and a
- jr nz, .fail
-
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVarAddr
- set SUBSTATUS_LOCK_ON, [hl]
- call AnimateCurrentMove
-
- ld hl, TookAimText
- jp StdBattleTextBox
-
-.fail
- call AnimateFailedMove
- jp PrintDidntAffect
-
-; 35a74
-
+INCLUDE "data/moves/flail_reversal_power.asm"
-BattleCommand_Sketch: ; 35a74
-; sketch
- call ClearLastMove
-; Don't sketch during a link battle
- ld a, [wLinkMode]
- and a
- jr z, .not_linked
- call AnimateFailedMove
- jp PrintNothingHappened
+INCLUDE "engine/battle/move_effects/counter.asm"
-.not_linked
-; If the opponent has a substitute up, fail.
- call CheckSubstituteOpp
- jp nz, .fail
-; If the opponent is transformed, fail.
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVarAddr
- bit SUBSTATUS_TRANSFORMED, [hl]
- jp nz, .fail
-; Get the user's moveset in its party struct.
-; This move replacement shall be permanent.
-; Pointer will be in de.
- ld a, MON_MOVES
- call UserPartyAttr
- ld d, h
- ld e, l
-; Get the battle move structs.
- ld hl, wBattleMonMoves
- ld a, [hBattleTurn]
- and a
- jr z, .get_last_move
- ld hl, wEnemyMonMoves
-.get_last_move
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- ld [wTypeMatchup], a
- ld b, a
-; Fail if move is invalid or is Struggle.
- and a
- jr z, .fail
- cp STRUGGLE
- jr z, .fail
-; Fail if user already knows that move
- ld c, NUM_MOVES
-.does_user_already_know_move
- ld a, [hli]
- cp b
- jr z, .fail
- dec c
- jr nz, .does_user_already_know_move
-; Find Sketch in the user's moveset.
-; Pointer in hl, and index in c.
- dec hl
- ld c, NUM_MOVES
-.find_sketch
- dec c
- ld a, [hld]
- cp SKETCH
- jr nz, .find_sketch
- inc hl
-; The Sketched move is loaded to that slot.
- ld a, b
- ld [hl], a
-; Copy the base PP from that move.
- push bc
- push hl
- dec a
- ld hl, Moves + MOVE_PP
- call GetMoveAttr
- pop hl
- ld bc, wBattleMonPP - wBattleMonMoves
- add hl, bc
- ld [hl], a
- pop bc
+INCLUDE "engine/battle/move_effects/encore.asm"
- ld a, [hBattleTurn]
- and a
- jr z, .user_trainer
- ld a, [wBattleMode]
- dec a
- jr nz, .user_trainer
-; wildmon
- ld a, [hl]
- push bc
- ld hl, wWildMonPP
- ld b, 0
- add hl, bc
- ld [hl], a
- ld hl, wWildMonMoves
- add hl, bc
- pop bc
- ld [hl], b
- jr .done_copy
+INCLUDE "engine/battle/move_effects/pain_split.asm"
-.user_trainer
- ld a, [hl]
- push af
- ld l, c
- ld h, 0
- add hl, de
- ld a, b
- ld [hl], a
- pop af
- ld de, MON_PP - MON_MOVES
- add hl, de
- ld [hl], a
-.done_copy
- call GetMoveName
- call AnimateCurrentMove
+INCLUDE "engine/battle/move_effects/snore.asm"
- ld hl, SketchedText
- jp StdBattleTextBox
+INCLUDE "engine/battle/move_effects/conversion2.asm"
-.fail
- call AnimateFailedMove
- jp PrintDidntAffect
+INCLUDE "engine/battle/move_effects/lock_on.asm"
-; 35b16
+INCLUDE "engine/battle/move_effects/sketch.asm"
BattleCommand_DefrostOpponent: ; 35b16
@@ -4357,338 +3590,15 @@ BattleCommand_DefrostOpponent: ; 35b16
; 35b33
-BattleCommand_SleepTalk: ; 35b33
-; sleeptalk
-
- call ClearLastMove
- ld a, [wAttackMissed]
- and a
- jr nz, .fail
- ld a, [hBattleTurn]
- and a
- ld hl, wBattleMonMoves + 1
- ld a, [wDisabledMove]
- ld d, a
- jr z, .got_moves
- ld hl, wEnemyMonMoves + 1
- ld a, [wEnemyDisabledMove]
- ld d, a
-.got_moves
- ld a, BATTLE_VARS_STATUS
- call GetBattleVar
- and SLP
- jr z, .fail
- ld a, [hl]
- and a
- jr z, .fail
- call .safely_check_has_usable_move
- jr c, .fail
- dec hl
-.sample_move
- push hl
- call BattleRandom
- maskbits NUM_MOVES
- ld c, a
- ld b, 0
- add hl, bc
- ld a, [hl]
- pop hl
- and a
- jr z, .sample_move
- ld e, a
- ld a, BATTLE_VARS_MOVE_ANIM
- call GetBattleVar
- cp e
- jr z, .sample_move
- ld a, e
- cp d
- jr z, .sample_move
- call .check_two_turn_move
- jr z, .sample_move
- ld a, BATTLE_VARS_MOVE
- call GetBattleVarAddr
- ld a, e
- ld [hl], a
- call CheckUserIsCharging
- jr nz, .charging
- ld a, [wKickCounter]
- push af
- call BattleCommand_LowerSub
- pop af
- ld [wKickCounter], a
-.charging
- call LoadMoveAnim
- call UpdateMoveData
- jp ResetTurn
-
-.fail
- call AnimateFailedMove
- jp TryPrintButItFailed
-
-.safely_check_has_usable_move
- push hl
- push de
- push bc
- call .check_has_usable_move
- pop bc
- pop de
- pop hl
- ret
-
-.check_has_usable_move
- ld a, [hBattleTurn]
- and a
- ld a, [wDisabledMove]
- jr z, .got_move_2
-
- ld a, [wEnemyDisabledMove]
-.got_move_2
- ld b, a
- ld a, BATTLE_VARS_MOVE
- call GetBattleVar
- ld c, a
- dec hl
- ld d, NUM_MOVES
-.loop2
- ld a, [hl]
- and a
- jr z, .carry
-
- cp c
- jr z, .nope
- cp b
- jr z, .nope
-
- call .check_two_turn_move
- jr nz, .no_carry
-
-.nope
- inc hl
- dec d
- jr nz, .loop2
-
-.carry
- scf
- ret
-
-.no_carry
- and a
- ret
-
-.check_two_turn_move
- push hl
- push de
- push bc
-
- ld b, a
- callfar GetMoveEffect
- ld a, b
-
- pop bc
- pop de
- pop hl
-
- cp EFFECT_SKULL_BASH
- ret z
- cp EFFECT_RAZOR_WIND
- ret z
- cp EFFECT_SKY_ATTACK
- ret z
- cp EFFECT_SOLARBEAM
- ret z
- cp EFFECT_FLY
- ret z
- cp EFFECT_BIDE
- ret
-
-; 35bff
-
-
-BattleCommand_DestinyBond: ; 35bff
-; destinybond
-
- ld a, BATTLE_VARS_SUBSTATUS5
- call GetBattleVarAddr
- set SUBSTATUS_DESTINY_BOND, [hl]
- call AnimateCurrentMove
- ld hl, DestinyBondEffectText
- jp StdBattleTextBox
-
-; 35c0f
-
-
-BattleCommand_Spite: ; 35c0f
-; spite
-
- ld a, [wAttackMissed]
- and a
- jp nz, .failed
- ld bc, PARTYMON_STRUCT_LENGTH ; ????
- ld hl, wEnemyMonMoves
- ld a, [hBattleTurn]
- and a
- jr z, .got_moves
- ld hl, wBattleMonMoves
-.got_moves
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- jr z, .failed
- cp STRUGGLE
- jr z, .failed
- ld b, a
- ld c, -1
-.loop
- inc c
- ld a, [hli]
- cp b
- jr nz, .loop
- ld [wTypeMatchup], a
- dec hl
- ld b, 0
- push bc
- ld c, wBattleMonPP - wBattleMonMoves
- add hl, bc
- pop bc
- ld a, [hl]
- and PP_MASK
- jr z, .failed
- push bc
- call GetMoveName
- ; lose 2-5 PP
- call BattleRandom
- and %11
- inc a
- inc a
- ld b, a
- ld a, [hl]
- and PP_MASK
- cp b
- jr nc, .deplete_pp
- ld b, a
-.deplete_pp
- ld a, [hl]
- sub b
- ld [hl], a
- push af
- ld a, MON_PP
- call OpponentPartyAttr
- ld d, b
- pop af
- pop bc
- add hl, bc
- ld e, a
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVar
- bit SUBSTATUS_TRANSFORMED, a
- jr nz, .transformed
- ld a, [hBattleTurn]
- and a
- jr nz, .not_wildmon
- ld a, [wBattleMode]
- dec a
- jr nz, .not_wildmon
- ld hl, wWildMonPP
- add hl, bc
-.not_wildmon
- ld [hl], e
-.transformed
- push de
- call AnimateCurrentMove
- pop de
- ld a, d
- ld [wTypeMatchup], a
- ld hl, SpiteEffectText
- jp StdBattleTextBox
-
-.failed
- jp PrintDidntAffect2
-
-; 35c94
-
-
-BattleCommand_FalseSwipe: ; 35c94
-; falseswipe
-
- ld hl, wEnemyMonHP
- ld a, [hBattleTurn]
- and a
- jr z, .got_hp
- ld hl, wBattleMonHP
-.got_hp
- ld de, wCurDamage
- ld c, 2
- push hl
- push de
- call StringCmp
- pop de
- pop hl
- jr c, .done
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hl]
- dec a
- ld [de], a
- inc a
- jr nz, .okay
- dec de
- ld a, [de]
- dec a
- ld [de], a
-.okay
- ld a, [wCriticalHit]
- cp 2
- jr nz, .carry
- xor a
- ld [wCriticalHit], a
-.carry
- scf
- ret
-
-.done
- and a
- ret
+INCLUDE "engine/battle/move_effects/sleep_talk.asm"
-; 35cc9
-
-
-BattleCommand_HealBell: ; 35cc9
-; healbell
-
- ld a, BATTLE_VARS_SUBSTATUS1
- call GetBattleVarAddr
- res SUBSTATUS_NIGHTMARE, [hl]
- ld de, wPartyMon1Status
- ld a, [hBattleTurn]
- and a
- jr z, .got_status
- ld de, wOTPartyMon1Status
-.got_status
- ld a, BATTLE_VARS_STATUS
- call GetBattleVarAddr
- xor a
- ld [hl], a
- ld h, d
- ld l, e
- ld bc, PARTYMON_STRUCT_LENGTH
- ld d, PARTY_LENGTH
-.loop
- ld [hl], a
- add hl, bc
- dec d
- jr nz, .loop
- call AnimateCurrentMove
+INCLUDE "engine/battle/move_effects/destiny_bond.asm"
- ld hl, BellChimedText
- call StdBattleTextBox
+INCLUDE "engine/battle/move_effects/spite.asm"
- ld a, [hBattleTurn]
- and a
- jp z, CalcPlayerStats
- jp CalcEnemyStats
+INCLUDE "engine/battle/move_effects/false_swipe.asm"
-; 35d00
+INCLUDE "engine/battle/move_effects/heal_bell.asm"
FarPlayBattleAnimation: ; 35d00
@@ -6385,111 +5295,7 @@ CalcStats: ; 3661d
; 36671
-BattleCommand_StoreEnergy: ; 36671
-; storeenergy
-
- ld a, BATTLE_VARS_SUBSTATUS3
- call GetBattleVar
- bit SUBSTATUS_BIDE, a
- ret z
-
- ld hl, wPlayerRolloutCount
- ld a, [hBattleTurn]
- and a
- jr z, .check_still_storing_energy
- ld hl, wEnemyRolloutCount
-.check_still_storing_energy
- dec [hl]
- jr nz, .still_storing
-
- ld a, BATTLE_VARS_SUBSTATUS3
- call GetBattleVarAddr
- res SUBSTATUS_BIDE, [hl]
-
- ld hl, UnleashedEnergyText
- call StdBattleTextBox
-
- ld a, BATTLE_VARS_MOVE_POWER
- call GetBattleVarAddr
- ld a, 1
- ld [hl], a
- ld hl, wPlayerDamageTaken + 1
- ld de, wPlayerCharging ; player
- ld a, [hBattleTurn]
- and a
- jr z, .player
- ld hl, wEnemyDamageTaken + 1
- ld de, wEnemyCharging ; enemy
-.player
- ld a, [hld]
- add a
- ld b, a
- ld [wCurDamage + 1], a
- ld a, [hl]
- rl a
- ld [wCurDamage], a
- jr nc, .not_maxed
- ld a, $ff
- ld [wCurDamage], a
- ld [wCurDamage + 1], a
-.not_maxed
- or b
- jr nz, .built_up_something
- ld a, 1
- ld [wAttackMissed], a
-.built_up_something
- xor a
- ld [hli], a
- ld [hl], a
- ld [de], a
-
- ld a, BATTLE_VARS_MOVE_ANIM
- call GetBattleVarAddr
- ld a, BIDE
- ld [hl], a
-
- ld b, unleashenergy_command
- jp SkipToBattleCommand
-
-.still_storing
- ld hl, StoringEnergyText
- call StdBattleTextBox
- jp EndMoveEffect
-
-; 366e5
-
-
-BattleCommand_UnleashEnergy: ; 366e5
-; unleashenergy
-
- ld de, wPlayerDamageTaken
- ld bc, wPlayerRolloutCount
- ld a, [hBattleTurn]
- and a
- jr z, .got_damage
- ld de, wEnemyDamageTaken
- ld bc, wEnemyRolloutCount
-.got_damage
- ld a, BATTLE_VARS_SUBSTATUS3
- call GetBattleVarAddr
- set SUBSTATUS_BIDE, [hl]
- xor a
- ld [de], a
- inc de
- ld [de], a
- ld [wPlayerMoveStructEffect], a
- ld [wEnemyMoveStructEffect], a
- call BattleRandom
- and 1
- inc a
- inc a
- ld [bc], a
- ld a, 1
- ld [wKickCounter], a
- call AnimateCurrentMove
- jp EndMoveEffect
-
-; 3671a
+INCLUDE "engine/battle/move_effects/bide.asm"
BattleCommand_CheckRampage: ; 3671a
@@ -6562,97 +5368,7 @@ BattleCommand_Rampage: ; 36751
; 36778
-BattleCommand_Teleport: ; 36778
-; teleport
-
- ld a, [wBattleType]
- cp BATTLETYPE_SHINY
- jr z, .failed
- cp BATTLETYPE_TRAP
- jr z, .failed
- cp BATTLETYPE_CELEBI
- jr z, .failed
- cp BATTLETYPE_SUICUNE
- jr z, .failed
-
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVar
- bit SUBSTATUS_CANT_RUN, a
- jr nz, .failed
-; Only need to check these next things if it's your turn
- ld a, [hBattleTurn]
- and a
- jr nz, .enemy_turn
-; Can't teleport from a trainer battle
- ld a, [wBattleMode]
- dec a
- jr nz, .failed
-; If your level is greater than the opponent's, you run without fail.
- ld a, [wCurPartyLevel]
- ld b, a
- ld a, [wBattleMonLevel]
- cp b
- jr nc, .run_away
-; Generate a number between 0 and (YourLevel + TheirLevel).
- add b
- ld c, a
- inc c
-.loop_player
- call BattleRandom
- cp c
- jr nc, .loop_player
-; If that number is greater than 4 times your level, run away.
- srl b
- srl b
- cp b
- jr nc, .run_away
-
-.failed
- call AnimateFailedMove
- jp PrintButItFailed
-
-.enemy_turn
- ld a, [wBattleMode]
- dec a
- jr nz, .failed
- ld a, [wBattleMonLevel]
- ld b, a
- ld a, [wCurPartyLevel]
- cp b
- jr nc, .run_away
- add b
- ld c, a
- inc c
-.loop_enemy
- call BattleRandom
- cp c
- jr nc, .loop_enemy
- srl b
- srl b
- cp b
- ; This does the wrong thing. What was
- ; probably intended was jr c, .failed
- ; The way this is made makes enemy use
- ; of Teleport always succeed if able
- jr nc, .run_away
-.run_away
- call UpdateBattleMonInParty
- xor a
- ld [wNumHits], a
- inc a
- ld [wForcedSwitch], a
- ld [wKickCounter], a
- call SetBattleDraw
- call BattleCommand_LowerSub
- call LoadMoveAnim
- ld c, 20
- call DelayFrames
- call SetBattleDraw
-
- ld hl, FledFromBattleText
- jp StdBattleTextBox
-
-; 36804
+INCLUDE "engine/battle/move_effects/teleport.asm"
SetBattleDraw: ; 36804
@@ -7301,7 +6017,7 @@ BattleCommand_Charge: ; 36b4d
jp EndMoveEffect
.UsedText:
- text_jump UnknownText_0x1c0d0e ; "[USER]"
+ text_jump UnknownText_0x1c0d0e ; "<USER>"
start_asm
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -7428,42 +6144,9 @@ BattleCommand_TrapTarget: ; 36c2d
; 36c7e
-BattleCommand_Mist: ; 36c7e
-; mist
-
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- bit SUBSTATUS_MIST, [hl]
- jr nz, .already_mist
- set SUBSTATUS_MIST, [hl]
- call AnimateCurrentMove
- ld hl, MistText
- jp StdBattleTextBox
-
-.already_mist
- call AnimateFailedMove
- jp PrintButItFailed
-
-; 36c98
+INCLUDE "engine/battle/move_effects/mist.asm"
-
-BattleCommand_FocusEnergy: ; 36c98
-; focusenergy
-
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- bit SUBSTATUS_FOCUS_ENERGY, [hl]
- jr nz, .already_pumped
- set SUBSTATUS_FOCUS_ENERGY, [hl]
- call AnimateCurrentMove
- ld hl, GettingPumpedText
- jp StdBattleTextBox
-
-.already_pumped
- call AnimateFailedMove
- jp PrintButItFailed
-
-; 36cb2
+INCLUDE "engine/battle/move_effects/focus_energy.asm"
BattleCommand_Recoil: ; 36cb2
@@ -7763,96 +6446,8 @@ CheckMoveTypeMatchesTarget: ; 36e5b
; 36e7c
-BattleCommand_Substitute: ; 36e7c
-; substitute
-
- call BattleCommand_MoveDelay
- ld hl, wBattleMonMaxHP
- ld de, wPlayerSubstituteHP
- ld a, [hBattleTurn]
- and a
- jr z, .got_hp
- ld hl, wEnemyMonMaxHP
- ld de, wEnemySubstituteHP
-.got_hp
-
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVar
- bit SUBSTATUS_SUBSTITUTE, a
- jr nz, .already_has_sub
-
- ld a, [hli]
- ld b, [hl]
- srl a
- rr b
- srl a
- rr b
- dec hl
- dec hl
- ld a, b
- ld [de], a
- ld a, [hld]
- sub b
- ld e, a
- ld a, [hl]
- sbc 0
- ld d, a
- jr c, .too_weak_to_sub
- ld a, d
- or e
- jr z, .too_weak_to_sub
- ld [hl], d
- inc hl
- ld [hl], e
-
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- set SUBSTATUS_SUBSTITUTE, [hl]
-
- ld hl, wPlayerWrapCount
- ld de, wPlayerTrappingMove
- ld a, [hBattleTurn]
- and a
- jr z, .player
- ld hl, wEnemyWrapCount
- ld de, wEnemyTrappingMove
-.player
-
- xor a
- ld [hl], a
- ld [de], a
- call _CheckBattleScene
- jr c, .no_anim
-
- xor a
- ld [wNumHits], a
- ld [wFXAnimID + 1], a
- ld [wKickCounter], a
- ld a, SUBSTITUTE
- call LoadAnim
- jr .finish
-
-.no_anim
- call BattleCommand_RaiseSubNoAnim
-.finish
- ld hl, MadeSubstituteText
- call StdBattleTextBox
- jp RefreshBattleHuds
-
-.already_has_sub
- call CheckUserIsCharging
- call nz, BattleCommand_RaiseSub
- ld hl, HasSubstituteText
- jr .jp_stdbattletextbox
-
-.too_weak_to_sub
- call CheckUserIsCharging
- call nz, BattleCommand_RaiseSub
- ld hl, TooWeakSubText
-.jp_stdbattletextbox
- jp StdBattleTextBox
+INCLUDE "engine/battle/move_effects/substitute.asm"
-; 36f0b
BattleCommand_RechargeNextTurn: ; 36f0b
; rechargenextturn
@@ -7875,14 +6470,7 @@ EndRechargeOpp: ; 36f13
; 36f1d
-BattleCommand_Rage: ; 36f1d
-; rage
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- set SUBSTATUS_RAGE, [hl]
- ret
-
-; 36f25
+INCLUDE "engine/battle/move_effects/rage.asm"
BattleCommand_DoubleFlyingDamage: ; 36f25
@@ -7923,316 +6511,17 @@ DoubleDamage: ; 36f37
; 36f46
-BattleCommand_Mimic: ; 36f46
-; mimic
-
- call ClearLastMove
- call BattleCommand_MoveDelay
- ld a, [wAttackMissed]
- and a
- jr nz, .fail
- ld hl, wBattleMonMoves
- ld a, [hBattleTurn]
- and a
- jr z, .player_turn
- ld hl, wEnemyMonMoves
-.player_turn
- call CheckHiddenOpponent
- jr nz, .fail
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- jr z, .fail
- cp STRUGGLE
- jr z, .fail
- ld b, a
- ld c, NUM_MOVES
-.check_already_knows_move
- ld a, [hli]
- cp b
- jr z, .fail
- dec c
- jr nz, .check_already_knows_move
- dec hl
-.find_mimic
- ld a, [hld]
- cp MIMIC
- jr nz, .find_mimic
- inc hl
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- ld [hl], a
- ld [wNamedObjectIndexBuffer], a
- ld bc, wBattleMonPP - wBattleMonMoves
- add hl, bc
- ld [hl], 5
- call GetMoveName
- call AnimateCurrentMove
- ld hl, LearnedMoveText
- jp StdBattleTextBox
-
-.fail
- jp FailMimic
-
-; 36f9d
-
-
-BattleCommand_LeechSeed: ; 36f9d
-; leechseed
- ld a, [wAttackMissed]
- and a
- jr nz, .evaded
- call CheckSubstituteOpp
- jr nz, .evaded
-
- ld de, wEnemyMonType1
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld de, wBattleMonType1
-.ok
-
- ld a, [de]
- cp GRASS
- jr z, .grass
- inc de
- ld a, [de]
- cp GRASS
- jr z, .grass
-
- ld a, BATTLE_VARS_SUBSTATUS4_OPP
- call GetBattleVarAddr
- bit SUBSTATUS_LEECH_SEED, [hl]
- jr nz, .evaded
- set SUBSTATUS_LEECH_SEED, [hl]
- call AnimateCurrentMove
- ld hl, WasSeededText
- jp StdBattleTextBox
-
-.grass
- call AnimateFailedMove
- jp PrintDoesntAffect
-
-.evaded
- call AnimateFailedMove
- ld hl, EvadedText
- jp StdBattleTextBox
-
-; 36fe1
-
-
-BattleCommand_Splash: ; 36fe1
- call AnimateCurrentMove
- farcall StubbedTrainerRankings_Splash
- jp PrintNothingHappened
-
-; 36fed
-
-
-BattleCommand_Disable: ; 36fed
-; disable
-
- ld a, [wAttackMissed]
- and a
- jr nz, .failed
-
- ld de, wEnemyDisableCount
- ld hl, wEnemyMonMoves
- ld a, [hBattleTurn]
- and a
- jr z, .got_moves
- ld de, wPlayerDisableCount
- ld hl, wBattleMonMoves
-.got_moves
-
- ld a, [de]
- and a
- jr nz, .failed
-
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- jr z, .failed
- cp STRUGGLE
- jr z, .failed
-
- ld b, a
- ld c, $ff
-.loop
- inc c
- ld a, [hli]
- cp b
- jr nz, .loop
-
- ld a, [hBattleTurn]
- and a
- ld hl, wEnemyMonPP
- jr z, .got_pp
- ld hl, wBattleMonPP
-.got_pp
- ld b, 0
- add hl, bc
- ld a, [hl]
- and a
- jr z, .failed
-.loop2
- call BattleRandom
- and 7
- jr z, .loop2
- inc a
- inc c
- swap c
- add c
- ld [de], a
- call AnimateCurrentMove
- ld hl, wDisabledMove
- ld a, [hBattleTurn]
- and a
- jr nz, .got_disabled_move_pointer
- inc hl
-.got_disabled_move_pointer
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- ld [hl], a
- ld [wNamedObjectIndexBuffer], a
- call GetMoveName
- ld hl, WasDisabledText
- jp StdBattleTextBox
-
-.failed
- jp FailDisable
-
-; 3705c
-
+INCLUDE "engine/battle/move_effects/mimic.asm"
-BattleCommand_PayDay: ; 3705c
-; payday
+INCLUDE "engine/battle/move_effects/leech_seed.asm"
- xor a
- ld hl, wStringBuffer1
- ld [hli], a
-
- ld a, [hBattleTurn]
- and a
- ld a, [wBattleMonLevel]
- jr z, .ok
- ld a, [wEnemyMonLevel]
-.ok
-
- add a
- ld hl, wPayDayMoney + 2
- add [hl]
- ld [hld], a
- jr nc, .done
- inc [hl]
- dec hl
- jr nz, .done
- inc [hl]
-.done
- ld hl, CoinsScatteredText
- jp StdBattleTextBox
-
-; 3707f
-
-
-BattleCommand_Conversion: ; 3707f
-; conversion
-
- ld hl, wBattleMonMoves
- ld de, wBattleMonType1
- ld a, [hBattleTurn]
- and a
- jr z, .got_moves
- ld hl, wEnemyMonMoves
- ld de, wEnemyMonType1
-.got_moves
- push de
- ld c, 0
- ld de, wStringBuffer1
-.loop
- push hl
- ld b, 0
- add hl, bc
- ld a, [hl]
- pop hl
- and a
- jr z, .okay
- push hl
- push bc
- dec a
- ld hl, Moves + MOVE_TYPE
- call GetMoveAttr
- ld [de], a
- inc de
- pop bc
- pop hl
- inc c
- ld a, c
- cp NUM_MOVES
- jr c, .loop
-.okay
- ld a, $ff
- ld [de], a
- inc de
- ld [de], a
- inc de
- ld [de], a
- pop de
- ld hl, wStringBuffer1
-.loop2
- ld a, [hl]
- cp -1
- jr z, .fail
- cp CURSE_T
- jr z, .next
- ld a, [de]
- cp [hl]
- jr z, .next
- inc de
- ld a, [de]
- dec de
- cp [hl]
- jr nz, .done
-.next
- inc hl
- jr .loop2
+INCLUDE "engine/battle/move_effects/splash.asm"
-.fail
- call AnimateFailedMove
- jp PrintButItFailed
+INCLUDE "engine/battle/move_effects/disable.asm"
-.done
-.loop3
- call BattleRandom
- maskbits NUM_MOVES
- ld c, a
- ld b, 0
- ld hl, wStringBuffer1
- add hl, bc
- ld a, [hl]
- cp -1
- jr z, .loop3
- cp CURSE_T
- jr z, .loop3
- ld a, [de]
- cp [hl]
- jr z, .loop3
- inc de
- ld a, [de]
- dec de
- cp [hl]
- jr z, .loop3
- ld a, [hl]
- ld [de], a
- inc de
- ld [de], a
- ld [wNamedObjectIndexBuffer], a
- farcall GetTypeName
- call AnimateCurrentMove
- ld hl, TransformedTypeText
- jp StdBattleTextBox
+INCLUDE "engine/battle/move_effects/pay_day.asm"
-; 3710e
+INCLUDE "engine/battle/move_effects/conversion.asm"
BattleCommand_ResetStats: ; 3710e
@@ -8355,7 +6644,9 @@ BattleCommand_Heal: ; 3713e
; 371cd
-INCLUDE "engine/battle/effect_commands/transform.asm"
+
+INCLUDE "engine/battle/move_effects/transform.asm"
+
BattleSideCopy: ; 372c6
; Copy bc bytes from hl to de if it's the player's turn.
@@ -8497,12 +6788,7 @@ PrintButItFailed: ; 3734e
; 37354
-FailSnore:
-FailDisable:
-FailConversion2:
-FailAttract:
-FailForesight:
-FailSpikes:
+FailMove:
call AnimateFailedMove
; fallthrough
; 37357
@@ -8549,42 +6835,11 @@ CheckSubstituteOpp: ; 37378
; 37380
-BattleCommand_Selfdestruct: ; 37380
- farcall StubbedTrainerRankings_Selfdestruct
- ld a, BATTLEANIM_PLAYER_DAMAGE
- ld [wNumHits], a
- ld c, 3
- call DelayFrames
- ld a, BATTLE_VARS_STATUS
- call GetBattleVarAddr
- xor a
- ld [hli], a
- inc hl
- ld [hli], a
- ld [hl], a
- ld a, $1
- ld [wKickCounter], a
- call BattleCommand_LowerSub
- call LoadMoveAnim
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- res SUBSTATUS_LEECH_SEED, [hl]
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVarAddr
- res SUBSTATUS_DESTINY_BOND, [hl]
- call _CheckBattleScene
- ret nc
- farcall DrawPlayerHUD
- farcall DrawEnemyHUD
- call WaitBGMap
- jp RefreshBattleHuds
+INCLUDE "engine/battle/move_effects/selfdestruct.asm"
-; 373c9
+INCLUDE "engine/battle/move_effects/mirror_move.asm"
-
-INCLUDE "engine/battle/effect_commands/mirror_move.asm"
-
-INCLUDE "engine/battle/effect_commands/metronome.asm"
+INCLUDE "engine/battle/move_effects/metronome.asm"
CheckUserMove: ; 37462
@@ -8631,7 +6886,7 @@ ResetTurn: ; 3747b
; 37492
-INCLUDE "engine/battle/effect_commands/thief.asm"
+INCLUDE "engine/battle/move_effects/thief.asm"
BattleCommand_ArenaTrap: ; 37517
@@ -8663,7 +6918,7 @@ BattleCommand_ArenaTrap: ; 37517
; 37536
-INCLUDE "engine/battle/effect_commands/nightmare.asm"
+INCLUDE "engine/battle/move_effects/nightmare.asm"
BattleCommand_Defrost: ; 37563
@@ -8700,21 +6955,21 @@ BattleCommand_Defrost: ; 37563
; 37588
-INCLUDE "engine/battle/effect_commands/curse.asm"
+INCLUDE "engine/battle/move_effects/curse.asm"
-INCLUDE "engine/battle/effect_commands/protect.asm"
+INCLUDE "engine/battle/move_effects/protect.asm"
-INCLUDE "engine/battle/effect_commands/endure.asm"
+INCLUDE "engine/battle/move_effects/endure.asm"
-INCLUDE "engine/battle/effect_commands/spikes.asm"
+INCLUDE "engine/battle/move_effects/spikes.asm"
-INCLUDE "engine/battle/effect_commands/foresight.asm"
+INCLUDE "engine/battle/move_effects/foresight.asm"
-INCLUDE "engine/battle/effect_commands/perish_song.asm"
+INCLUDE "engine/battle/move_effects/perish_song.asm"
-INCLUDE "engine/battle/effect_commands/sandstorm.asm"
+INCLUDE "engine/battle/move_effects/sandstorm.asm"
-INCLUDE "engine/battle/effect_commands/rollout.asm"
+INCLUDE "engine/battle/move_effects/rollout.asm"
BattleCommand5d: ; 37791
@@ -8724,158 +6979,17 @@ BattleCommand5d: ; 37791
; 37792
-BattleCommand_FuryCutter: ; 37792
-; furycutter
-
- ld hl, wPlayerFuryCutterCount
- ld a, [hBattleTurn]
- and a
- jr z, .go
- ld hl, wEnemyFuryCutterCount
-
-.go
- ld a, [wAttackMissed]
- and a
- jp nz, ResetFuryCutterCount
-
- inc [hl]
-
-; Damage capped at 5 turns' worth (16x).
- ld a, [hl]
- ld b, a
- cp 6
- jr c, .checkdouble
- ld b, 5
-
-.checkdouble
- dec b
- ret z
-
-; Double the damage
- ld hl, wCurDamage + 1
- sla [hl]
- dec hl
- rl [hl]
- jr nc, .checkdouble
-
-; No overflow
- ld a, $ff
- ld [hli], a
- ld [hl], a
- ret
-
-; 377be
-
+INCLUDE "engine/battle/move_effects/fury_cutter.asm"
-ResetFuryCutterCount: ; 377be
+INCLUDE "engine/battle/move_effects/attract.asm"
- push hl
-
- ld hl, wPlayerFuryCutterCount
- ld a, [hBattleTurn]
- and a
- jr z, .reset
- ld hl, wEnemyFuryCutterCount
-
-.reset
- xor a
- ld [hl], a
+INCLUDE "engine/battle/move_effects/return.asm"
- pop hl
- ret
+INCLUDE "engine/battle/move_effects/present.asm"
-; 377ce
+INCLUDE "engine/battle/move_effects/frustration.asm"
-
-INCLUDE "engine/battle/effect_commands/attract.asm"
-
-BattleCommand_HappinessPower: ; 3784b
-; happinesspower
- push bc
- ld hl, wBattleMonHappiness
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld hl, wEnemyMonHappiness
-.ok
- xor a
- ld [hMultiplicand + 0], a
- ld [hMultiplicand + 1], a
- ld a, [hl]
- ld [hMultiplicand + 2], a
- ld a, 10
- ld [hMultiplier], a
- call Multiply
- ld a, 25
- ld [hDivisor], a
- ld b, 4
- call Divide
- ld a, [hQuotient + 2]
- ld d, a
- pop bc
- ret
-
-; 37874
-
-
-INCLUDE "engine/battle/effect_commands/present.asm"
-
-BattleCommand_FrustrationPower: ; 3790e
-; frustrationpower
-
- push bc
- ld hl, wBattleMonHappiness
- ld a, [hBattleTurn]
- and a
- jr z, .got_happiness
- ld hl, wEnemyMonHappiness
-.got_happiness
- ld a, $ff
- sub [hl]
- ld [hMultiplicand + 2], a
- xor a
- ld [hMultiplicand + 0], a
- ld [hMultiplicand + 1], a
- ld a, 10
- ld [hMultiplier], a
- call Multiply
- ld a, 25
- ld [hDivisor], a
- ld b, 4
- call Divide
- ld a, [hQuotient + 2]
- ld d, a
- pop bc
- ret
-
-; 37939
-
-
-BattleCommand_Safeguard: ; 37939
-; safeguard
-
- ld hl, wPlayerScreens
- ld de, wPlayerSafeguardCount
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld hl, wEnemyScreens
- ld de, wEnemySafeguardCount
-.ok
- bit SCREENS_SAFEGUARD, [hl]
- jr nz, .failed
- set SCREENS_SAFEGUARD, [hl]
- ld a, 5
- ld [de], a
- call AnimateCurrentMove
- ld hl, CoveredByVeilText
- jp StdBattleTextBox
-
-.failed
- call AnimateFailedMove
- jp PrintButItFailed
-
-; 37962
+INCLUDE "engine/battle/move_effects/safeguard.asm"
SafeCheckSafeguard: ; 37962
@@ -8914,355 +7028,13 @@ BattleCommand_CheckSafeguard: ; 37972
; 37991
-BattleCommand_GetMagnitude: ; 37991
-; getmagnitude
-
- push bc
- call BattleRandom
- ld b, a
- ld hl, .Magnitudes
-.loop
- ld a, [hli]
- cp b
- jr nc, .ok
- inc hl
- inc hl
- jr .loop
-
-.ok
- ld d, [hl]
- push de
- inc hl
- ld a, [hl]
- ld [wTypeMatchup], a
- call BattleCommand_MoveDelay
- ld hl, MagnitudeText
- call StdBattleTextBox
- pop de
- pop bc
- ret
-
-.Magnitudes:
- ; /255, BP, magnitude
- db 13, 10, 4
- db 38, 30, 5
- db 89, 50, 6
- db 166, 70, 7
- db 217, 90, 8
- db 242, 110, 9
- db 255, 150, 10
-; 379c9
-
-
-BattleCommand_BatonPass: ; 379c9
-; batonpass
-
- ld a, [hBattleTurn]
- and a
- jp nz, .Enemy
-
-
-; Need something to switch to
- call CheckAnyOtherAlivePartyMons
- jp z, FailedBatonPass
-
- call UpdateBattleMonInParty
- call AnimateCurrentMove
-
- ld c, 50
- call DelayFrames
-
-; Transition into switchmon menu
- call LoadStandardMenuDataHeader
- farcall SetUpBattlePartyMenu_NoLoop
-
- farcall ForcePickSwitchMonInBattle
-
-; Return to battle scene
- call ClearPalettes
- farcall _LoadBattleFontsHPBar
- call CloseWindow
- call ClearSprites
- hlcoord 1, 0
- lb bc, 4, 10
- call ClearBox
- ld b, SCGB_BATTLE_COLORS
- call GetSGBLayout
- call SetPalettes
- call BatonPass_LinkPlayerSwitch
-
-; Mobile link battles handle entrances differently
- farcall CheckMobileBattleError
- jp c, EndMoveEffect
-
- ld hl, PassedBattleMonEntrance
- call CallBattleCore
-
- call ResetBatonPassStatus
- ret
-
-
-.Enemy:
-
-; Wildmons don't have anything to switch to
- ld a, [wBattleMode]
- dec a ; WILDMON
- jp z, FailedBatonPass
-
- call CheckAnyOtherAliveEnemyMons
- jp z, FailedBatonPass
-
- call UpdateEnemyMonInParty
- call AnimateCurrentMove
- call BatonPass_LinkEnemySwitch
-
-; Mobile link battles handle entrances differently
- farcall CheckMobileBattleError
- jp c, EndMoveEffect
-
-; Passed enemy PartyMon entrance
- xor a
- ld [wEnemySwitchMonIndex], a
- ld hl, EnemySwitch_SetMode
- call CallBattleCore
- ld hl, ResetBattleParticipants
- call CallBattleCore
- ld a, 1
- ld [wTypeMatchup], a
- ld hl, ApplyStatLevelMultiplierOnAllStats
- call CallBattleCore
-
- ld hl, SpikesDamage
- call CallBattleCore
-
- jr ResetBatonPassStatus
-
-; 37a67
-
-
-BatonPass_LinkPlayerSwitch: ; 37a67
- ld a, [wLinkMode]
- and a
- ret z
-
- ld a, 1
- ld [wBattlePlayerAction], a
-
- call LoadStandardMenuDataHeader
- ld hl, LinkBattleSendReceiveAction
- call CallBattleCore
- call CloseWindow
-
- xor a
- ld [wBattlePlayerAction], a
- ret
-
-; 37a82
-
-
-BatonPass_LinkEnemySwitch: ; 37a82
- ld a, [wLinkMode]
- and a
- ret z
-
- call LoadStandardMenuDataHeader
- ld hl, LinkBattleSendReceiveAction
- call CallBattleCore
-
- ld a, [wOTPartyCount]
- add BATTLEACTION_SWITCH1
- ld b, a
- ld a, [wBattleAction]
- cp BATTLEACTION_SWITCH1
- jr c, .baton_pass
- cp b
- jr c, .switch
-
-.baton_pass
- ld a, [wCurOTMon]
- add BATTLEACTION_SWITCH1
- ld [wBattleAction], a
-.switch
- jp CloseWindow
-
-; 37aab
-
-
-FailedBatonPass: ; 37aab
- call AnimateFailedMove
- jp PrintButItFailed
-
-; 37ab1
-
-
-ResetBatonPassStatus: ; 37ab1
-; Reset status changes that aren't passed by Baton Pass.
-
- ; Nightmare isn't passed.
- ld a, BATTLE_VARS_STATUS
- call GetBattleVar
- and SLP
- jr nz, .ok
-
- ld a, BATTLE_VARS_SUBSTATUS1
- call GetBattleVarAddr
- res SUBSTATUS_NIGHTMARE, [hl]
-.ok
-
- ; Disable isn't passed.
- call ResetActorDisable
-
- ; Attraction isn't passed.
- ld hl, wPlayerSubStatus1
- res SUBSTATUS_IN_LOVE, [hl]
- ld hl, wEnemySubStatus1
- res SUBSTATUS_IN_LOVE, [hl]
- ld hl, wPlayerSubStatus5
-
- ld a, BATTLE_VARS_SUBSTATUS5
- call GetBattleVarAddr
- res SUBSTATUS_TRANSFORMED, [hl]
- res SUBSTATUS_ENCORED, [hl]
-
- ; New mon hasn't used a move yet.
- ld a, BATTLE_VARS_LAST_MOVE
- call GetBattleVarAddr
- ld [hl], 0
-
- xor a
- ld [wPlayerWrapCount], a
- ld [wEnemyWrapCount], a
- ret
-
-; 37ae9
-
-
-CheckAnyOtherAlivePartyMons: ; 37ae9
- ld hl, wPartyMon1HP
- ld a, [wPartyCount]
- ld d, a
- ld a, [wCurBattleMon]
- ld e, a
- jr CheckAnyOtherAliveMons
-
-; 37af6
+INCLUDE "engine/battle/move_effects/magnitude.asm"
+INCLUDE "engine/battle/move_effects/baton_pass.asm"
-CheckAnyOtherAliveEnemyMons: ; 37af6
- ld hl, wOTPartyMon1HP
- ld a, [wOTPartyCount]
- ld d, a
- ld a, [wCurOTMon]
- ld e, a
-
- ; fallthrough
-; 37b01
+INCLUDE "engine/battle/move_effects/pursuit.asm"
-CheckAnyOtherAliveMons: ; 37b01
-; Check for nonzero HP starting from partymon
-; HP at hl for d partymons, besides current mon e.
-
-; Return nz if any are alive.
-
- xor a
- ld b, a
- ld c, a
-.loop
- ld a, c
- cp d
- jr z, .done
- cp e
- jr z, .next
-
- ld a, [hli]
- or b
- ld b, a
- ld a, [hld]
- or b
- ld b, a
-
-.next
- push bc
- ld bc, PARTYMON_STRUCT_LENGTH
- add hl, bc
- pop bc
- inc c
- jr .loop
-
-.done
- ld a, b
- and a
- ret
-
-; 37b1d
-
-
-BattleCommand_Pursuit: ; 37b1d
-; pursuit
-; Double damage if the opponent is switching.
-
- ld hl, wEnemyIsSwitching
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld hl, wPlayerIsSwitching
-.ok
- ld a, [hl]
- and a
- ret z
-
- ld hl, wCurDamage + 1
- sla [hl]
- dec hl
- rl [hl]
- ret nc
-
- ld a, $ff
- ld [hli], a
- ld [hl], a
- ret
-
-; 37b39
-
-
-BattleCommand_ClearHazards: ; 37b39
-; clearhazards
-
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- bit SUBSTATUS_LEECH_SEED, [hl]
- jr z, .not_leeched
- res SUBSTATUS_LEECH_SEED, [hl]
- ld hl, ShedLeechSeedText
- call StdBattleTextBox
-.not_leeched
-
- ld hl, wPlayerScreens
- ld de, wPlayerWrapCount
- ld a, [hBattleTurn]
- and a
- jr z, .got_screens_wrap
- ld hl, wEnemyScreens
- ld de, wEnemyWrapCount
-.got_screens_wrap
- bit SCREENS_SPIKES, [hl]
- jr z, .no_spikes
- res SCREENS_SPIKES, [hl]
- ld hl, BlewSpikesText
- push de
- call StdBattleTextBox
- pop de
-.no_spikes
-
- ld a, [de]
- and a
- ret z
- xor a
- ld [de], a
- ld hl, ReleasedByText
- jp StdBattleTextBox
-
-; 37b74
+INCLUDE "engine/battle/move_effects/rapid_spin.asm"
BattleCommand_HealMorn: ; 37b74
@@ -9310,14 +7082,14 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e
; Don't factor in time of day in link battles.
ld a, [wLinkMode]
and a
- jr nz, .checkWeather
+ jr nz, .Weather
ld a, [wTimeOfDay]
cp b
- jr z, .checkWeather
+ jr z, .Weather
dec c ; double
-.checkWeather:
+.Weather:
ld a, [wBattleWeather]
and a
jr z, .Heal
@@ -9369,196 +7141,17 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e
; 37be8
-BattleCommand_HiddenPower: ; 37be8
-; hiddenpower
-
- ld a, [wAttackMissed]
- and a
- ret nz
- farcall HiddenPowerDamage
- ret
-
-; 37bf4
-
-
-BattleCommand_StartRain: ; 37bf4
-; startrain
- ld a, WEATHER_RAIN
- ld [wBattleWeather], a
- ld a, 5
- ld [wWeatherCount], a
- call AnimateCurrentMove
- ld hl, DownpourText
- jp StdBattleTextBox
-
-; 37c07
-
-
-BattleCommand_StartSun: ; 37c07
-; startsun
- ld a, WEATHER_SUN
- ld [wBattleWeather], a
- ld a, 5
- ld [wWeatherCount], a
- call AnimateCurrentMove
- ld hl, SunGotBrightText
- jp StdBattleTextBox
-
-; 37c1a
-
-
-BattleCommand_BellyDrum: ; 37c1a
-; bellydrum
-; This command is buggy because it raises the user's attack
-; 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, [wAttackMissed]
- and a
- jr nz, .failed
-
- callfar GetHalfMaxHP
- callfar CheckUserHasEnoughHP
- jr nc, .failed
-
- push bc
- call AnimateCurrentMove
- pop bc
- callfar SubtractHPFromUser
- call UpdateUserInParty
- ld a, 5
-
-.max_attack_loop
- push af
- call BattleCommand_AttackUp2
- pop af
- dec a
- jr nz, .max_attack_loop
-
- ld hl, BellyDrumText
- jp StdBattleTextBox
+INCLUDE "engine/battle/move_effects/hidden_power.asm"
-.failed
- call AnimateFailedMove
- jp PrintButItFailed
+INCLUDE "engine/battle/move_effects/rain_dance.asm"
-; 37c55
+INCLUDE "engine/battle/move_effects/sunny_day.asm"
+INCLUDE "engine/battle/move_effects/belly_drum.asm"
-BattleCommand_PsychUp: ; 37c55
-; psychup
+INCLUDE "engine/battle/move_effects/psych_up.asm"
- ld hl, wEnemyStatLevels
- ld de, wPlayerStatLevels
- ld a, [hBattleTurn]
- and a
- jr z, .pointers_correct
-; It's the enemy's turn, so swap the pointers.
- push hl
- ld h, d
- ld l, e
- pop de
-.pointers_correct
- push hl
- ld b, NUM_LEVEL_STATS
-; If any of the enemy's stats is modified from its base level,
-; the move succeeds. Otherwise, it fails.
-.loop
- ld a, [hli]
- cp BASE_STAT_LEVEL
- jr nz, .break
- dec b
- jr nz, .loop
- pop hl
- call AnimateFailedMove
- jp PrintButItFailed
-
-.break
- pop hl
- ld b, NUM_LEVEL_STATS
-.loop2
- ld a, [hli]
- ld [de], a
- inc de
- dec b
- jr nz, .loop2
- ld a, [hBattleTurn]
- and a
- jr nz, .calc_enemy_stats
- call CalcPlayerStats
- jr .merge
-
-.calc_enemy_stats
- call CalcEnemyStats
-.merge
- call AnimateCurrentMove
- ld hl, CopiedStatsText
- jp StdBattleTextBox
-
-; 37c95
-
-
-BattleCommand_MirrorCoat: ; 37c95
-; mirrorcoat
-
- ld a, 1
- ld [wAttackMissed], a
-
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- and a
- ret z
-
- ld b, a
- callfar GetMoveEffect
- ld a, b
- cp EFFECT_MIRROR_COAT
- ret z
-
- call BattleCommand_ResetTypeMatchup
- ld a, [wTypeMatchup]
- and a
- ret z
-
- call CheckOpponentWentFirst
- ret z
-
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
- call GetBattleVar
- dec a
- ld de, wStringBuffer1
- call GetMoveData
-
- ld a, [wStringBuffer1 + 2]
- and a
- ret z
-
- ld a, [wStringBuffer1 + 3]
- cp SPECIAL
- ret c
-
- ld hl, wCurDamage
- ld a, [hli]
- or [hl]
- ret z
-
- ld a, [hl]
- add a
- ld [hld], a
- ld a, [hl]
- adc a
- ld [hl], a
- jr nc, .capped
- ld a, $ff
- ld [hli], a
- ld [hl], a
-.capped
-
- xor a
- ld [wAttackMissed], a
- ret
-
-; 37ce6
+INCLUDE "engine/battle/move_effects/mirror_coat.asm"
BattleCommand_DoubleMinimizeDamage: ; 37ce6
@@ -9597,113 +7190,9 @@ BattleCommand_SkipSunCharge: ; 37d02
; 37d0d
-BattleCommand_CheckFutureSight: ; 37d0d
-; checkfuturesight
+INCLUDE "engine/battle/move_effects/future_sight.asm"
- ld hl, wPlayerFutureSightCount
- ld de, wPlayerFutureSightDamage
- ld a, [hBattleTurn]
- and a
- jr z, .ok
- ld hl, wEnemyFutureSightCount
- ld de, wEnemyFutureSightDamage
-.ok
-
- ld a, [hl]
- and a
- ret z
- cp 1
- ret nz
-
- ld [hl], 0
- ld a, [de]
- inc de
- ld [wCurDamage], a
- ld a, [de]
- ld [wCurDamage + 1], a
- ld b, futuresight_command
- jp SkipToBattleCommand
-
-; 37d34
-
-BattleCommand_FutureSight: ; 37d34
-; futuresight
-
- call CheckUserIsCharging
- jr nz, .AlreadyChargingFutureSight
- ld a, BATTLE_VARS_MOVE_ANIM
- call GetBattleVar
- ld b, a
- ld a, BATTLE_VARS_LAST_COUNTER_MOVE
- call GetBattleVarAddr
- ld [hl], b
- ld a, BATTLE_VARS_LAST_MOVE
- call GetBattleVarAddr
- ld [hl], b
-.AlreadyChargingFutureSight:
- ld hl, wPlayerFutureSightCount
- ld a, [hBattleTurn]
- and a
- jr z, .GotFutureSightCount
- ld hl, wEnemyFutureSightCount
-.GotFutureSightCount:
- ld a, [hl]
- and a
- jr nz, .failed
- ld a, 4
- ld [hl], a
- call BattleCommand_LowerSub
- call BattleCommand_MoveDelay
- ld hl, ForesawAttackText
- call StdBattleTextBox
- call BattleCommand_RaiseSub
- ld de, wPlayerFutureSightDamage
- ld a, [hBattleTurn]
- and a
- jr z, .StoreDamage
- ld de, wEnemyFutureSightDamage
-.StoreDamage:
- ld hl, wCurDamage
- ld a, [hl]
- ld [de], a
- ld [hl], 0
- inc hl
- inc de
- ld a, [hl]
- ld [de], a
- ld [hl], 0
- jp EndMoveEffect
-
-.failed
- pop bc
- call ResetDamage
- call AnimateFailedMove
- call PrintButItFailed
- jp EndMoveEffect
-
-; 37d94
-
-
-BattleCommand_ThunderAccuracy: ; 37d94
-; thunderaccuracy
-
- ld a, BATTLE_VARS_MOVE_TYPE
- call GetBattleVarAddr
- inc hl
- ld a, [wBattleWeather]
- cp WEATHER_RAIN
- jr z, .rain
- cp WEATHER_SUN
- ret nz
- ld [hl], 50 percent + 1
- ret
-
-.rain
- ; Redundant with CheckHit guranteeing hit
- ld [hl], 100 percent
- ret
-
-; 37daa
+INCLUDE "engine/battle/move_effects/thunder.asm"
CheckHiddenOpponent: ; 37daa
@@ -9845,7 +7334,6 @@ LoadMoveAnim: ; 37e36
LoadAnim: ; 37e44
-
ld [wFXAnimID], a
; fallthrough
diff --git a/engine/battle/menu.asm b/engine/battle/menu.asm
index c97cd7854..705df3729 100755
--- a/engine/battle/menu.asm
+++ b/engine/battle/menu.asm
@@ -1,6 +1,6 @@
LoadBattleMenu: ; 24ef2
- ld hl, BattleMenuDataHeader
- call LoadMenuDataHeader
+ ld hl, BattleMenuHeader
+ call LoadMenuHeader
ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a
call InterpretBattleMenu
@@ -12,14 +12,14 @@ LoadBattleMenu: ; 24ef2
SafariBattleMenu: ; 24f0b
; untranslated
- ld hl, MenuDataHeader_0x24f4e
- call LoadMenuDataHeader
+ ld hl, MenuHeader_0x24f4e
+ call LoadMenuHeader
jr Function24f19
; 24f13
ContestBattleMenu: ; 24f13
- ld hl, MenuDataHeader_0x24f89
- call LoadMenuDataHeader
+ ld hl, MenuHeader_0x24f89
+ call LoadMenuHeader
; 24f19
Function24f19: ; 24f19
@@ -32,7 +32,7 @@ Function24f19: ; 24f19
ret
; 24f2c
-BattleMenuDataHeader: ; 24f2c
+BattleMenuHeader: ; 24f2c
db MENU_BACKUP_TILES ; flags
menu_coords 8, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw MenuData_0x24f34
@@ -54,7 +54,7 @@ Strings24f3d: ; 0x24f3d
db "RUN@"
; 24f4e
-MenuDataHeader_0x24f4e: ; 24f4e
+MenuHeader_0x24f4e: ; 24f4e
db MENU_BACKUP_TILES ; flags
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw MenuData_0x24f56
@@ -84,7 +84,7 @@ Function24f7c: ; 24f7c
ret
; 24f89
-MenuDataHeader_0x24f89: ; 24f89
+MenuHeader_0x24f89: ; 24f89
db MENU_BACKUP_TILES ; flags
menu_coords 2, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw MenuData_0x24f91
diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm
index b79c274b9..581f5381e 100644
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -52,7 +52,7 @@ GetPlayerBackpicCoords: ; fbd9d (3e:7d9d)
DoWeatherModifiers: ; fbda4
- ld de, .WeatherTypeModifiers
+ ld de, WeatherTypeModifiers
ld a, [wBattleWeather]
ld b, a
ld a, [wd265] ; move type
@@ -78,7 +78,7 @@ DoWeatherModifiers: ; fbda4
.done_weather_types
- ld de, .WeatherMoveModifiers
+ ld de, WeatherMoveModifiers
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -145,17 +145,7 @@ DoWeatherModifiers: ; fbda4
.done
ret
-.WeatherTypeModifiers:
- db WEATHER_RAIN, WATER, MORE_EFFECTIVE
- db WEATHER_RAIN, FIRE, NOT_VERY_EFFECTIVE
- db WEATHER_SUN, FIRE, MORE_EFFECTIVE
- db WEATHER_SUN, WATER, NOT_VERY_EFFECTIVE
- db -1 ; end
-
-.WeatherMoveModifiers:
- db WEATHER_RAIN, EFFECT_SOLARBEAM, NOT_VERY_EFFECTIVE
- db -1 ; end
-; fbe24
+INCLUDE "data/battle/weather_modifiers.asm"
DoBadgeTypeBoosts: ; fbe24
@@ -174,7 +164,7 @@ DoBadgeTypeBoosts: ; fbe24
push de
push bc
- ld hl, .BadgeTypes
+ ld hl, BadgeTypeBoosts
ld a, [wKantoBadges]
ld b, a
@@ -235,25 +225,4 @@ DoBadgeTypeBoosts: ; fbe24
pop de
ret
-.BadgeTypes:
-; entries correspond to wJohtoBadges constants
- db FLYING ; ZEPHYRBADGE
- db BUG ; HIVEBADGE
- db NORMAL ; PLAINBADGE
- db GHOST ; FOGBADGE
- db STEEL ; MINERALBADGE
- db FIGHTING ; STORMBADGE
- db ICE ; GLACIERBADGE
- db DRAGON ; RISINGBADGE
- ; fallthrough
-; entries correspond to wKantoBadges constants
- db ROCK ; BOULDERBADGE
- db WATER ; CASCADEBADGE
- db ELECTRIC ; THUNDERBADGE
- db GRASS ; RAINBOWBADGE
- db POISON ; SOULBADGE
- db PSYCHIC ; MARSHBADGE
- db FIRE ; VOLCANOBADGE
- db GROUND ; EARTHBADGE
- db -1 ; end
-; fbe91
+INCLUDE "data/types/badge_type_boosts.asm"
diff --git a/engine/battle/effect_commands/attract.asm b/engine/battle/move_effects/attract.asm
index da6a9c0e9..026176694 100755
--- a/engine/battle/effect_commands/attract.asm
+++ b/engine/battle/move_effects/attract.asm
@@ -20,7 +20,7 @@ BattleCommand_Attract: ; 377ce
jp StdBattleTextBox
.failed
- jp FailAttract
+ jp FailMove
; 377f5
diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm
new file mode 100644
index 000000000..369565877
--- /dev/null
+++ b/engine/battle/move_effects/baton_pass.asm
@@ -0,0 +1,241 @@
+BattleCommand_BatonPass: ; 379c9
+; batonpass
+
+ ld a, [hBattleTurn]
+ and a
+ jp nz, .Enemy
+
+
+; Need something to switch to
+ call CheckAnyOtherAlivePartyMons
+ jp z, FailedBatonPass
+
+ call UpdateBattleMonInParty
+ call AnimateCurrentMove
+
+ ld c, 50
+ call DelayFrames
+
+; Transition into switchmon menu
+ call LoadStandardMenuHeader
+ farcall SetUpBattlePartyMenu_NoLoop
+
+ farcall ForcePickSwitchMonInBattle
+
+; Return to battle scene
+ call ClearPalettes
+ farcall _LoadBattleFontsHPBar
+ call CloseWindow
+ call ClearSprites
+ hlcoord 1, 0
+ lb bc, 4, 10
+ call ClearBox
+ ld b, SCGB_BATTLE_COLORS
+ call GetSGBLayout
+ call SetPalettes
+ call BatonPass_LinkPlayerSwitch
+
+; Mobile link battles handle entrances differently
+ farcall CheckMobileBattleError
+ jp c, EndMoveEffect
+
+ ld hl, PassedBattleMonEntrance
+ call CallBattleCore
+
+ call ResetBatonPassStatus
+ ret
+
+
+.Enemy:
+
+; Wildmons don't have anything to switch to
+ ld a, [wBattleMode]
+ dec a ; WILDMON
+ jp z, FailedBatonPass
+
+ call CheckAnyOtherAliveEnemyMons
+ jp z, FailedBatonPass
+
+ call UpdateEnemyMonInParty
+ call AnimateCurrentMove
+ call BatonPass_LinkEnemySwitch
+
+; Mobile link battles handle entrances differently
+ farcall CheckMobileBattleError
+ jp c, EndMoveEffect
+
+; Passed enemy PartyMon entrance
+ xor a
+ ld [wEnemySwitchMonIndex], a
+ ld hl, EnemySwitch_SetMode
+ call CallBattleCore
+ ld hl, ResetBattleParticipants
+ call CallBattleCore
+ ld a, 1
+ ld [wTypeMatchup], a
+ ld hl, ApplyStatLevelMultiplierOnAllStats
+ call CallBattleCore
+
+ ld hl, SpikesDamage
+ call CallBattleCore
+
+ jr ResetBatonPassStatus
+
+; 37a67
+
+
+BatonPass_LinkPlayerSwitch: ; 37a67
+ ld a, [wLinkMode]
+ and a
+ ret z
+
+ ld a, 1
+ ld [wBattlePlayerAction], a
+
+ call LoadStandardMenuHeader
+ ld hl, LinkBattleSendReceiveAction
+ call CallBattleCore
+ call CloseWindow
+
+ xor a
+ ld [wBattlePlayerAction], a
+ ret
+
+; 37a82
+
+
+BatonPass_LinkEnemySwitch: ; 37a82
+ ld a, [wLinkMode]
+ and a
+ ret z
+
+ call LoadStandardMenuHeader
+ ld hl, LinkBattleSendReceiveAction
+ call CallBattleCore
+
+ ld a, [wOTPartyCount]
+ add BATTLEACTION_SWITCH1
+ ld b, a
+ ld a, [wBattleAction]
+ cp BATTLEACTION_SWITCH1
+ jr c, .baton_pass
+ cp b
+ jr c, .switch
+
+.baton_pass
+ ld a, [wCurOTMon]
+ add BATTLEACTION_SWITCH1
+ ld [wBattleAction], a
+.switch
+ jp CloseWindow
+
+; 37aab
+
+
+FailedBatonPass: ; 37aab
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+; 37ab1
+
+
+ResetBatonPassStatus: ; 37ab1
+; Reset status changes that aren't passed by Baton Pass.
+
+ ; Nightmare isn't passed.
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVar
+ and SLP
+ jr nz, .ok
+
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call GetBattleVarAddr
+ res SUBSTATUS_NIGHTMARE, [hl]
+.ok
+
+ ; Disable isn't passed.
+ call ResetActorDisable
+
+ ; Attraction isn't passed.
+ ld hl, wPlayerSubStatus1
+ res SUBSTATUS_IN_LOVE, [hl]
+ ld hl, wEnemySubStatus1
+ res SUBSTATUS_IN_LOVE, [hl]
+ ld hl, wPlayerSubStatus5
+
+ ld a, BATTLE_VARS_SUBSTATUS5
+ call GetBattleVarAddr
+ res SUBSTATUS_TRANSFORMED, [hl]
+ res SUBSTATUS_ENCORED, [hl]
+
+ ; New mon hasn't used a move yet.
+ ld a, BATTLE_VARS_LAST_MOVE
+ call GetBattleVarAddr
+ ld [hl], 0
+
+ xor a
+ ld [wPlayerWrapCount], a
+ ld [wEnemyWrapCount], a
+ ret
+
+; 37ae9
+
+
+CheckAnyOtherAlivePartyMons: ; 37ae9
+ ld hl, wPartyMon1HP
+ ld a, [wPartyCount]
+ ld d, a
+ ld a, [wCurBattleMon]
+ ld e, a
+ jr CheckAnyOtherAliveMons
+
+; 37af6
+
+
+CheckAnyOtherAliveEnemyMons: ; 37af6
+ ld hl, wOTPartyMon1HP
+ ld a, [wOTPartyCount]
+ ld d, a
+ ld a, [wCurOTMon]
+ ld e, a
+
+ ; fallthrough
+; 37b01
+
+CheckAnyOtherAliveMons: ; 37b01
+; Check for nonzero HP starting from partymon
+; HP at hl for d partymons, besides current mon e.
+
+; Return nz if any are alive.
+
+ xor a
+ ld b, a
+ ld c, a
+.loop
+ ld a, c
+ cp d
+ jr z, .done
+ cp e
+ jr z, .next
+
+ ld a, [hli]
+ or b
+ ld b, a
+ ld a, [hld]
+ or b
+ ld b, a
+
+.next
+ push bc
+ ld bc, PARTYMON_STRUCT_LENGTH
+ add hl, bc
+ pop bc
+ inc c
+ jr .loop
+
+.done
+ ld a, b
+ and a
+ ret
+
+; 37b1d
diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm
new file mode 100644
index 000000000..18e350504
--- /dev/null
+++ b/engine/battle/move_effects/beat_up.asm
@@ -0,0 +1,219 @@
+BattleCommand_BeatUp: ; 35461
+; beatup
+
+ call ResetDamage
+ ld a, [hBattleTurn]
+ and a
+ jp nz, .enemy_beats_up
+ ld a, [wPlayerSubStatus3]
+ bit SUBSTATUS_IN_LOOP, a
+ jr nz, .next_mon
+ ld c, 20
+ call DelayFrames
+ xor a
+ ld [wPlayerRolloutCount], a
+ ld [wd002], a
+ ld [wBeatUpHitAtLeastOnce], a
+ jr .got_mon
+
+.next_mon
+ ld a, [wPlayerRolloutCount]
+ ld b, a
+ ld a, [wPartyCount]
+ sub b
+ ld [wd002], a
+
+.got_mon
+ ld a, [wd002]
+ ld hl, wPartyMonNicknames
+ call GetNick
+ ld a, MON_HP
+ call GetBeatupMonLocation
+ ld a, [hli]
+ or [hl]
+ jp z, .beatup_fail ; fainted
+ ld a, [wd002]
+ ld c, a
+ ld a, [wCurBattleMon]
+ ; BUG: this can desynchronize link battles
+ ; Change "cp [hl]" to "cp c" to fix
+ cp [hl]
+ ld hl, wBattleMonStatus
+ jr z, .active_mon
+ ld a, MON_STATUS
+ call GetBeatupMonLocation
+.active_mon
+ ld a, [hl]
+ and a
+ jp nz, .beatup_fail
+
+ ld a, $1
+ ld [wBeatUpHitAtLeastOnce], a
+ ld hl, BeatUpAttackText
+ call StdBattleTextBox
+ ld a, [wEnemyMonSpecies]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseDefense]
+ ld c, a
+ push bc
+ ld a, MON_SPECIES
+ call GetBeatupMonLocation
+ ld a, [hl]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseAttack]
+ pop bc
+ ld b, a
+ push bc
+ ld a, MON_LEVEL
+ call GetBeatupMonLocation
+ ld a, [hl]
+ ld e, a
+ pop bc
+ ld a, [wPlayerMoveStructPower]
+ ld d, a
+ ret
+
+.enemy_beats_up
+ ld a, [wEnemySubStatus3]
+ bit SUBSTATUS_IN_LOOP, a
+ jr nz, .not_first_enemy_beatup
+
+ xor a
+ ld [wEnemyRolloutCount], a
+ ld [wd002], a
+ ld [wBeatUpHitAtLeastOnce], a
+ jr .enemy_continue
+
+.not_first_enemy_beatup
+ ld a, [wEnemyRolloutCount]
+ ld b, a
+ ld a, [wOTPartyCount]
+ sub b
+ ld [wd002], a
+.enemy_continue
+ ld a, [wBattleMode]
+ dec a
+ jr z, .wild
+
+ ld a, [wLinkMode]
+ and a
+ jr nz, .link_or_tower
+
+ ld a, [wInBattleTowerBattle]
+ and a
+ jr nz, .link_or_tower
+
+ ld a, [wd002]
+ ld c, a
+ ld b, 0
+ ld hl, wOTPartySpecies
+ add hl, bc
+ ld a, [hl]
+ ld [wNamedObjectIndexBuffer], a
+ call GetPokemonName
+ jr .got_enemy_nick
+
+.link_or_tower
+ ld a, [wd002]
+ ld hl, wOTPartyMonNicknames
+ ld bc, NAME_LENGTH
+ call AddNTimes
+ ld de, wStringBuffer1
+ call CopyBytes
+.got_enemy_nick
+ ld a, MON_HP
+ call GetBeatupMonLocation
+ ld a, [hli]
+ or [hl]
+ jp z, .beatup_fail
+ ld a, [wd002]
+ ld b, a
+ ld a, [wCurOTMon]
+ cp b
+ ld hl, wEnemyMonStatus
+ jr z, .active_enemy
+
+ ld a, MON_STATUS
+ call GetBeatupMonLocation
+.active_enemy
+ ld a, [hl]
+ and a
+ jr nz, .beatup_fail
+
+ ld a, $1
+ ld [wBeatUpHitAtLeastOnce], a
+ jr .finish_beatup
+
+.wild
+ ld a, [wEnemyMonSpecies]
+ ld [wNamedObjectIndexBuffer], a
+ call GetPokemonName
+ ld hl, BeatUpAttackText
+ call StdBattleTextBox
+ jp EnemyAttackDamage
+
+.finish_beatup
+ ld hl, BeatUpAttackText
+ call StdBattleTextBox
+ ld a, [wBattleMonSpecies]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseDefense]
+ ld c, a
+ push bc
+ ld a, MON_SPECIES
+ call GetBeatupMonLocation
+ ld a, [hl]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseAttack]
+ pop bc
+ ld b, a
+ push bc
+ ld a, MON_LEVEL
+ call GetBeatupMonLocation
+ ld a, [hl]
+ ld e, a
+ pop bc
+ ld a, [wEnemyMoveStructPower]
+ ld d, a
+ ret
+
+; 355b0
+
+
+.beatup_fail ; 355b0
+ ld b, buildopponentrage_command
+ jp SkipToBattleCommand
+
+; 355b5
+
+
+BattleCommanda8: ; 355b5
+ ld a, [wBeatUpHitAtLeastOnce]
+ and a
+ ret nz
+
+ jp PrintButItFailed
+
+; 355bd
+
+
+GetBeatupMonLocation: ; 355bd
+ push bc
+ ld c, a
+ ld b, 0
+ ld a, [hBattleTurn]
+ and a
+ ld hl, wPartyMon1Species
+ jr z, .got_species
+ ld hl, wOTPartyMon1Species
+
+.got_species
+ ld a, [wd002]
+ add hl, bc
+ call GetPartyLocation
+ pop bc
+ ret
diff --git a/engine/battle/move_effects/belly_drum.asm b/engine/battle/move_effects/belly_drum.asm
new file mode 100644
index 000000000..bd300c9cd
--- /dev/null
+++ b/engine/battle/move_effects/belly_drum.asm
@@ -0,0 +1,36 @@
+BattleCommand_BellyDrum: ; 37c1a
+; bellydrum
+; This command is buggy because it raises the user's attack
+; 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, [wAttackMissed]
+ and a
+ jr nz, .failed
+
+ callfar GetHalfMaxHP
+ callfar CheckUserHasEnoughHP
+ jr nc, .failed
+
+ push bc
+ call AnimateCurrentMove
+ pop bc
+ callfar SubtractHPFromUser
+ call UpdateUserInParty
+ ld a, 5
+
+.max_attack_loop
+ push af
+ call BattleCommand_AttackUp2
+ pop af
+ dec a
+ jr nz, .max_attack_loop
+
+ ld hl, BellyDrumText
+ jp StdBattleTextBox
+
+.failed
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+; 37c55
diff --git a/engine/battle/move_effects/bide.asm b/engine/battle/move_effects/bide.asm
new file mode 100644
index 000000000..d9958ca53
--- /dev/null
+++ b/engine/battle/move_effects/bide.asm
@@ -0,0 +1,105 @@
+BattleCommand_StoreEnergy: ; 36671
+; storeenergy
+
+ ld a, BATTLE_VARS_SUBSTATUS3
+ call GetBattleVar
+ bit SUBSTATUS_BIDE, a
+ ret z
+
+ ld hl, wPlayerRolloutCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .check_still_storing_energy
+ ld hl, wEnemyRolloutCount
+.check_still_storing_energy
+ dec [hl]
+ jr nz, .still_storing
+
+ ld a, BATTLE_VARS_SUBSTATUS3
+ call GetBattleVarAddr
+ res SUBSTATUS_BIDE, [hl]
+
+ ld hl, UnleashedEnergyText
+ call StdBattleTextBox
+
+ ld a, BATTLE_VARS_MOVE_POWER
+ call GetBattleVarAddr
+ ld a, 1
+ ld [hl], a
+ ld hl, wPlayerDamageTaken + 1
+ ld de, wPlayerCharging ; player
+ ld a, [hBattleTurn]
+ and a
+ jr z, .player
+ ld hl, wEnemyDamageTaken + 1
+ ld de, wEnemyCharging ; enemy
+.player
+ ld a, [hld]
+ add a
+ ld b, a
+ ld [wCurDamage + 1], a
+ ld a, [hl]
+ rl a
+ ld [wCurDamage], a
+ jr nc, .not_maxed
+ ld a, $ff
+ ld [wCurDamage], a
+ ld [wCurDamage + 1], a
+.not_maxed
+ or b
+ jr nz, .built_up_something
+ ld a, 1
+ ld [wAttackMissed], a
+.built_up_something
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ld [de], a
+
+ ld a, BATTLE_VARS_MOVE_ANIM
+ call GetBattleVarAddr
+ ld a, BIDE
+ ld [hl], a
+
+ ld b, unleashenergy_command
+ jp SkipToBattleCommand
+
+.still_storing
+ ld hl, StoringEnergyText
+ call StdBattleTextBox
+ jp EndMoveEffect
+
+; 366e5
+
+
+BattleCommand_UnleashEnergy: ; 366e5
+; unleashenergy
+
+ ld de, wPlayerDamageTaken
+ ld bc, wPlayerRolloutCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_damage
+ ld de, wEnemyDamageTaken
+ ld bc, wEnemyRolloutCount
+.got_damage
+ ld a, BATTLE_VARS_SUBSTATUS3
+ call GetBattleVarAddr
+ set SUBSTATUS_BIDE, [hl]
+ xor a
+ ld [de], a
+ inc de
+ ld [de], a
+ ld [wPlayerMoveStructEffect], a
+ ld [wEnemyMoveStructEffect], a
+ call BattleRandom
+ and 1
+ inc a
+ inc a
+ ld [bc], a
+ ld a, 1
+ ld [wKickCounter], a
+ call AnimateCurrentMove
+ jp EndMoveEffect
+
+; 3671a
diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm
new file mode 100644
index 000000000..d66d23a5e
--- /dev/null
+++ b/engine/battle/move_effects/conversion.asm
@@ -0,0 +1,98 @@
+BattleCommand_Conversion: ; 3707f
+; conversion
+
+ ld hl, wBattleMonMoves
+ ld de, wBattleMonType1
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_moves
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyMonType1
+.got_moves
+ push de
+ ld c, 0
+ ld de, wStringBuffer1
+.loop
+ push hl
+ ld b, 0
+ add hl, bc
+ ld a, [hl]
+ pop hl
+ and a
+ jr z, .okay
+ push hl
+ push bc
+ dec a
+ ld hl, Moves + MOVE_TYPE
+ call GetMoveAttr
+ ld [de], a
+ inc de
+ pop bc
+ pop hl
+ inc c
+ ld a, c
+ cp NUM_MOVES
+ jr c, .loop
+.okay
+ ld a, $ff
+ ld [de], a
+ inc de
+ ld [de], a
+ inc de
+ ld [de], a
+ pop de
+ ld hl, wStringBuffer1
+.loop2
+ ld a, [hl]
+ cp -1
+ jr z, .fail
+ cp CURSE_T
+ jr z, .next
+ ld a, [de]
+ cp [hl]
+ jr z, .next
+ inc de
+ ld a, [de]
+ dec de
+ cp [hl]
+ jr nz, .done
+.next
+ inc hl
+ jr .loop2
+
+.fail
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+.done
+.loop3
+ call BattleRandom
+ maskbits NUM_MOVES
+ ld c, a
+ ld b, 0
+ ld hl, wStringBuffer1
+ add hl, bc
+ ld a, [hl]
+ cp -1
+ jr z, .loop3
+ cp CURSE_T
+ jr z, .loop3
+ ld a, [de]
+ cp [hl]
+ jr z, .loop3
+ inc de
+ ld a, [de]
+ dec de
+ cp [hl]
+ jr z, .loop3
+ ld a, [hl]
+ ld [de], a
+ inc de
+ ld [de], a
+ ld [wNamedObjectIndexBuffer], a
+ farcall GetTypeName
+ call AnimateCurrentMove
+ ld hl, TransformedTypeText
+ jp StdBattleTextBox
+
+; 3710e
diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm
new file mode 100644
index 000000000..7fefbfee5
--- /dev/null
+++ b/engine/battle/move_effects/conversion2.asm
@@ -0,0 +1,66 @@
+BattleCommand_Conversion2: ; 359e6
+; conversion2
+
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .failed
+ ld hl, wBattleMonType1
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_type
+ ld hl, wEnemyMonType1
+.got_type
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ jr z, .failed
+ push hl
+ dec a
+ ld hl, Moves + MOVE_TYPE
+ call GetMoveAttr
+ ld d, a
+ pop hl
+ cp CURSE_T
+ jr z, .failed
+ call AnimateCurrentMove
+ call BattleCommand_SwitchTurn
+
+.loop
+ call BattleRandom
+ and $1f
+ cp UNUSED_TYPES
+ jr c, .okay
+ cp UNUSED_TYPES_END
+ jr c, .loop
+ cp TYPES_END
+ jr nc, .loop
+.okay
+ ld [hli], a
+ ld [hld], a
+ push hl
+ ld a, BATTLE_VARS_MOVE_TYPE
+ call GetBattleVarAddr
+ push af
+ push hl
+ ld a, d
+ ld [hl], a
+ call BattleCheckTypeMatchup
+ pop hl
+ pop af
+ ld [hl], a
+ pop hl
+ ld a, [wTypeMatchup]
+ cp 10
+ jr nc, .loop
+ call BattleCommand_SwitchTurn
+
+ ld a, [hl]
+ ld [wNamedObjectIndexBuffer], a
+ predef GetTypeName
+ ld hl, TransformedTypeText
+ jp StdBattleTextBox
+
+.failed
+ jp FailMove
+
+; 35a53
diff --git a/engine/battle/move_effects/counter.asm b/engine/battle/move_effects/counter.asm
new file mode 100644
index 000000000..b811b293c
--- /dev/null
+++ b/engine/battle/move_effects/counter.asm
@@ -0,0 +1,60 @@
+BattleCommand_Counter: ; 35813
+; counter
+
+ ld a, 1
+ ld [wAttackMissed], a
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ ret z
+
+ ld b, a
+ callfar GetMoveEffect
+ ld a, b
+ cp EFFECT_COUNTER
+ ret z
+
+ call BattleCommand_ResetTypeMatchup
+ ld a, [wTypeMatchup]
+ and a
+ ret z
+
+ call CheckOpponentWentFirst
+ ret z
+
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ dec a
+ ld de, wStringBuffer1
+ call GetMoveData
+
+ ld a, [wStringBuffer1 + MOVE_POWER]
+ and a
+ ret z
+
+ ld a, [wStringBuffer1 + MOVE_TYPE]
+ cp SPECIAL
+ ret nc
+
+ ld hl, wCurDamage
+ ld a, [hli]
+ or [hl]
+ ret z
+
+ ld a, [hl]
+ add a
+ ld [hld], a
+ ld a, [hl]
+ adc a
+ ld [hl], a
+ jr nc, .capped
+ ld a, $ff
+ ld [hli], a
+ ld [hl], a
+.capped
+
+ xor a
+ ld [wAttackMissed], a
+ ret
+
+; 35864
diff --git a/engine/battle/effect_commands/curse.asm b/engine/battle/move_effects/curse.asm
index b11b9f3fb..b11b9f3fb 100644
--- a/engine/battle/effect_commands/curse.asm
+++ b/engine/battle/move_effects/curse.asm
diff --git a/engine/battle/move_effects/destiny_bond.asm b/engine/battle/move_effects/destiny_bond.asm
new file mode 100644
index 000000000..2dc125ddf
--- /dev/null
+++ b/engine/battle/move_effects/destiny_bond.asm
@@ -0,0 +1,11 @@
+BattleCommand_DestinyBond: ; 35bff
+; destinybond
+
+ ld a, BATTLE_VARS_SUBSTATUS5
+ call GetBattleVarAddr
+ set SUBSTATUS_DESTINY_BOND, [hl]
+ call AnimateCurrentMove
+ ld hl, DestinyBondEffectText
+ jp StdBattleTextBox
+
+; 35c0f
diff --git a/engine/battle/move_effects/disable.asm b/engine/battle/move_effects/disable.asm
new file mode 100644
index 000000000..5df785d24
--- /dev/null
+++ b/engine/battle/move_effects/disable.asm
@@ -0,0 +1,74 @@
+BattleCommand_Disable: ; 36fed
+; disable
+
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .failed
+
+ ld de, wEnemyDisableCount
+ ld hl, wEnemyMonMoves
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_moves
+ ld de, wPlayerDisableCount
+ ld hl, wBattleMonMoves
+.got_moves
+
+ ld a, [de]
+ and a
+ jr nz, .failed
+
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ jr z, .failed
+ cp STRUGGLE
+ jr z, .failed
+
+ ld b, a
+ ld c, $ff
+.loop
+ inc c
+ ld a, [hli]
+ cp b
+ jr nz, .loop
+
+ ld a, [hBattleTurn]
+ and a
+ ld hl, wEnemyMonPP
+ jr z, .got_pp
+ ld hl, wBattleMonPP
+.got_pp
+ ld b, 0
+ add hl, bc
+ ld a, [hl]
+ and a
+ jr z, .failed
+.loop2
+ call BattleRandom
+ and 7
+ jr z, .loop2
+ inc a
+ inc c
+ swap c
+ add c
+ ld [de], a
+ call AnimateCurrentMove
+ ld hl, wDisabledMove
+ ld a, [hBattleTurn]
+ and a
+ jr nz, .got_disabled_move_pointer
+ inc hl
+.got_disabled_move_pointer
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ ld [hl], a
+ ld [wNamedObjectIndexBuffer], a
+ call GetMoveName
+ ld hl, WasDisabledText
+ jp StdBattleTextBox
+
+.failed
+ jp FailMove
+
+; 3705c
diff --git a/engine/battle/move_effects/encore.asm b/engine/battle/move_effects/encore.asm
new file mode 100644
index 000000000..e6607fb11
--- /dev/null
+++ b/engine/battle/move_effects/encore.asm
@@ -0,0 +1,122 @@
+BattleCommand_Encore: ; 35864
+; encore
+
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyEncoreCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld hl, wBattleMonMoves
+ ld de, wPlayerEncoreCount
+.ok
+ ld a, BATTLE_VARS_LAST_MOVE_OPP
+ call GetBattleVar
+ and a
+ jp z, .failed
+ cp STRUGGLE
+ jp z, .failed
+ cp ENCORE
+ jp z, .failed
+ cp MIRROR_MOVE
+ jp z, .failed
+ ld b, a
+
+.got_move
+ ld a, [hli]
+ cp b
+ jr nz, .got_move
+
+ ld bc, wBattleMonPP - wBattleMonMoves - 1
+ add hl, bc
+ ld a, [hl]
+ and PP_MASK
+ jp z, .failed
+ ld a, [wAttackMissed]
+ and a
+ jp nz, .failed
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVarAddr
+ bit SUBSTATUS_ENCORED, [hl]
+ jp nz, .failed
+ set SUBSTATUS_ENCORED, [hl]
+ call BattleRandom
+ and $3
+ inc a
+ inc a
+ inc a
+ ld [de], a
+ call CheckOpponentWentFirst
+ jr nz, .finish_move
+ ld a, [hBattleTurn]
+ and a
+ jr z, .force_last_enemy_move
+
+ push hl
+ ld a, [wLastPlayerMove]
+ ld b, a
+ ld c, 0
+ ld hl, wBattleMonMoves
+.find_player_move
+ ld a, [hli]
+ cp b
+ jr z, .got_player_move
+ inc c
+ ld a, c
+ cp NUM_MOVES
+ jr c, .find_player_move
+ pop hl
+ res SUBSTATUS_ENCORED, [hl]
+ xor a
+ ld [de], a
+ jr .failed
+
+.got_player_move
+ pop hl
+ ld a, c
+ ld [wCurMoveNum], a
+ ld a, b
+ ld [wCurPlayerMove], a
+ dec a
+ ld de, wPlayerMoveStruct
+ call GetMoveData
+ jr .finish_move
+
+.force_last_enemy_move
+ push hl
+ ld a, [wLastEnemyMove]
+ ld b, a
+ ld c, 0
+ ld hl, wEnemyMonMoves
+.find_enemy_move
+ ld a, [hli]
+ cp b
+ jr z, .got_enemy_move
+ inc c
+ ld a, c
+ cp NUM_MOVES
+ jr c, .find_enemy_move
+ pop hl
+ res SUBSTATUS_ENCORED, [hl]
+ xor a
+ ld [de], a
+ jr .failed
+
+.got_enemy_move
+ pop hl
+ ld a, c
+ ld [wCurEnemyMoveNum], a
+ ld a, b
+ ld [wCurEnemyMove], a
+ dec a
+ ld de, wEnemyMoveStruct
+ call GetMoveData
+
+.finish_move
+ call AnimateCurrentMove
+ ld hl, GotAnEncoreText
+ jp StdBattleTextBox
+
+.failed
+ jp PrintDidntAffect2
+
+; 35926
diff --git a/engine/battle/effect_commands/endure.asm b/engine/battle/move_effects/endure.asm
index ed4329ff5..ed4329ff5 100644
--- a/engine/battle/effect_commands/endure.asm
+++ b/engine/battle/move_effects/endure.asm
diff --git a/engine/battle/move_effects/false_swipe.asm b/engine/battle/move_effects/false_swipe.asm
new file mode 100644
index 000000000..e93b627ec
--- /dev/null
+++ b/engine/battle/move_effects/false_swipe.asm
@@ -0,0 +1,44 @@
+BattleCommand_FalseSwipe: ; 35c94
+; falseswipe
+
+ ld hl, wEnemyMonHP
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_hp
+ ld hl, wBattleMonHP
+.got_hp
+ ld de, wCurDamage
+ ld c, 2
+ push hl
+ push de
+ call StringCmp
+ pop de
+ pop hl
+ jr c, .done
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hl]
+ dec a
+ ld [de], a
+ inc a
+ jr nz, .okay
+ dec de
+ ld a, [de]
+ dec a
+ ld [de], a
+.okay
+ ld a, [wCriticalHit]
+ cp 2
+ jr nz, .carry
+ xor a
+ ld [wCriticalHit], a
+.carry
+ scf
+ ret
+
+.done
+ and a
+ ret
+
+; 35cc9
diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm
new file mode 100644
index 000000000..2a3726c53
--- /dev/null
+++ b/engine/battle/move_effects/focus_energy.asm
@@ -0,0 +1,17 @@
+BattleCommand_FocusEnergy: ; 36c98
+; focusenergy
+
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ bit SUBSTATUS_FOCUS_ENERGY, [hl]
+ jr nz, .already_pumped
+ set SUBSTATUS_FOCUS_ENERGY, [hl]
+ call AnimateCurrentMove
+ ld hl, GettingPumpedText
+ jp StdBattleTextBox
+
+.already_pumped
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+; 36cb2
diff --git a/engine/battle/effect_commands/foresight.asm b/engine/battle/move_effects/foresight.asm
index 006e3b3d7..8c51bb220 100644
--- a/engine/battle/effect_commands/foresight.asm
+++ b/engine/battle/move_effects/foresight.asm
@@ -19,5 +19,5 @@ BattleCommand_Foresight: ; 376a0
jp StdBattleTextBox
.failed
- jp FailForesight
+ jp FailMove
; 376c2
diff --git a/engine/battle/move_effects/frustration.asm b/engine/battle/move_effects/frustration.asm
new file mode 100644
index 000000000..3f8456ced
--- /dev/null
+++ b/engine/battle/move_effects/frustration.asm
@@ -0,0 +1,29 @@
+BattleCommand_FrustrationPower: ; 3790e
+; frustrationpower
+
+ push bc
+ ld hl, wBattleMonHappiness
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_happiness
+ ld hl, wEnemyMonHappiness
+.got_happiness
+ ld a, $ff
+ sub [hl]
+ ld [hMultiplicand + 2], a
+ xor a
+ ld [hMultiplicand + 0], a
+ ld [hMultiplicand + 1], a
+ ld a, 10
+ ld [hMultiplier], a
+ call Multiply
+ ld a, 25
+ ld [hDivisor], a
+ ld b, 4
+ call Divide
+ ld a, [hQuotient + 2]
+ ld d, a
+ pop bc
+ ret
+
+; 37939
diff --git a/engine/battle/move_effects/fury_cutter.asm b/engine/battle/move_effects/fury_cutter.asm
new file mode 100644
index 000000000..91679368f
--- /dev/null
+++ b/engine/battle/move_effects/fury_cutter.asm
@@ -0,0 +1,61 @@
+BattleCommand_FuryCutter: ; 37792
+; furycutter
+
+ ld hl, wPlayerFuryCutterCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .go
+ ld hl, wEnemyFuryCutterCount
+
+.go
+ ld a, [wAttackMissed]
+ and a
+ jp nz, ResetFuryCutterCount
+
+ inc [hl]
+
+; Damage capped at 5 turns' worth (16x).
+ ld a, [hl]
+ ld b, a
+ cp 6
+ jr c, .checkdouble
+ ld b, 5
+
+.checkdouble
+ dec b
+ ret z
+
+; Double the damage
+ ld hl, wCurDamage + 1
+ sla [hl]
+ dec hl
+ rl [hl]
+ jr nc, .checkdouble
+
+; No overflow
+ ld a, $ff
+ ld [hli], a
+ ld [hl], a
+ ret
+
+; 377be
+
+
+ResetFuryCutterCount: ; 377be
+
+ push hl
+
+ ld hl, wPlayerFuryCutterCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .reset
+ ld hl, wEnemyFuryCutterCount
+
+.reset
+ xor a
+ ld [hl], a
+
+ pop hl
+ ret
+
+; 377ce
diff --git a/engine/battle/move_effects/future_sight.asm b/engine/battle/move_effects/future_sight.asm
new file mode 100644
index 000000000..fa2148ab7
--- /dev/null
+++ b/engine/battle/move_effects/future_sight.asm
@@ -0,0 +1,85 @@
+BattleCommand_CheckFutureSight: ; 37d0d
+; checkfuturesight
+
+ ld hl, wPlayerFutureSightCount
+ ld de, wPlayerFutureSightDamage
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld hl, wEnemyFutureSightCount
+ ld de, wEnemyFutureSightDamage
+.ok
+
+ ld a, [hl]
+ and a
+ ret z
+ cp 1
+ ret nz
+
+ ld [hl], 0
+ ld a, [de]
+ inc de
+ ld [wCurDamage], a
+ ld a, [de]
+ ld [wCurDamage + 1], a
+ ld b, futuresight_command
+ jp SkipToBattleCommand
+
+; 37d34
+
+BattleCommand_FutureSight: ; 37d34
+; futuresight
+
+ call CheckUserIsCharging
+ jr nz, .AlreadyChargingFutureSight
+ ld a, BATTLE_VARS_MOVE_ANIM
+ call GetBattleVar
+ ld b, a
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE
+ call GetBattleVarAddr
+ ld [hl], b
+ ld a, BATTLE_VARS_LAST_MOVE
+ call GetBattleVarAddr
+ ld [hl], b
+.AlreadyChargingFutureSight:
+ ld hl, wPlayerFutureSightCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .GotFutureSightCount
+ ld hl, wEnemyFutureSightCount
+.GotFutureSightCount:
+ ld a, [hl]
+ and a
+ jr nz, .failed
+ ld a, 4
+ ld [hl], a
+ call BattleCommand_LowerSub
+ call BattleCommand_MoveDelay
+ ld hl, ForesawAttackText
+ call StdBattleTextBox
+ call BattleCommand_RaiseSub
+ ld de, wPlayerFutureSightDamage
+ ld a, [hBattleTurn]
+ and a
+ jr z, .StoreDamage
+ ld de, wEnemyFutureSightDamage
+.StoreDamage:
+ ld hl, wCurDamage
+ ld a, [hl]
+ ld [de], a
+ ld [hl], 0
+ inc hl
+ inc de
+ ld a, [hl]
+ ld [de], a
+ ld [hl], 0
+ jp EndMoveEffect
+
+.failed
+ pop bc
+ call ResetDamage
+ call AnimateFailedMove
+ call PrintButItFailed
+ jp EndMoveEffect
+
+; 37d94
diff --git a/engine/battle/move_effects/heal_bell.asm b/engine/battle/move_effects/heal_bell.asm
new file mode 100644
index 000000000..c79362f9c
--- /dev/null
+++ b/engine/battle/move_effects/heal_bell.asm
@@ -0,0 +1,36 @@
+BattleCommand_HealBell: ; 35cc9
+; healbell
+
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call GetBattleVarAddr
+ res SUBSTATUS_NIGHTMARE, [hl]
+ ld de, wPartyMon1Status
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_status
+ ld de, wOTPartyMon1Status
+.got_status
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVarAddr
+ xor a
+ ld [hl], a
+ ld h, d
+ ld l, e
+ ld bc, PARTYMON_STRUCT_LENGTH
+ ld d, PARTY_LENGTH
+.loop
+ ld [hl], a
+ add hl, bc
+ dec d
+ jr nz, .loop
+ call AnimateCurrentMove
+
+ ld hl, BellChimedText
+ call StdBattleTextBox
+
+ ld a, [hBattleTurn]
+ and a
+ jp z, CalcPlayerStats
+ jp CalcEnemyStats
+
+; 35d00
diff --git a/engine/battle/move_effects/hidden_power.asm b/engine/battle/move_effects/hidden_power.asm
new file mode 100644
index 000000000..f96becf97
--- /dev/null
+++ b/engine/battle/move_effects/hidden_power.asm
@@ -0,0 +1,10 @@
+BattleCommand_HiddenPower: ; 37be8
+; hiddenpower
+
+ ld a, [wAttackMissed]
+ and a
+ ret nz
+ farcall HiddenPowerDamage
+ ret
+
+; 37bf4
diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm
new file mode 100644
index 000000000..328a2c416
--- /dev/null
+++ b/engine/battle/move_effects/leech_seed.asm
@@ -0,0 +1,42 @@
+BattleCommand_LeechSeed: ; 36f9d
+; leechseed
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .evaded
+ call CheckSubstituteOpp
+ jr nz, .evaded
+
+ ld de, wEnemyMonType1
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld de, wBattleMonType1
+.ok
+
+ ld a, [de]
+ cp GRASS
+ jr z, .grass
+ inc de
+ ld a, [de]
+ cp GRASS
+ jr z, .grass
+
+ ld a, BATTLE_VARS_SUBSTATUS4_OPP
+ call GetBattleVarAddr
+ bit SUBSTATUS_LEECH_SEED, [hl]
+ jr nz, .evaded
+ set SUBSTATUS_LEECH_SEED, [hl]
+ call AnimateCurrentMove
+ ld hl, WasSeededText
+ jp StdBattleTextBox
+
+.grass
+ call AnimateFailedMove
+ jp PrintDoesntAffect
+
+.evaded
+ call AnimateFailedMove
+ ld hl, EvadedText
+ jp StdBattleTextBox
+
+; 36fe1
diff --git a/engine/battle/move_effects/lock_on.asm b/engine/battle/move_effects/lock_on.asm
new file mode 100644
index 000000000..36d8db926
--- /dev/null
+++ b/engine/battle/move_effects/lock_on.asm
@@ -0,0 +1,23 @@
+BattleCommand_LockOn: ; 35a53
+; lockon
+
+ call CheckSubstituteOpp
+ jr nz, .fail
+
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .fail
+
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVarAddr
+ set SUBSTATUS_LOCK_ON, [hl]
+ call AnimateCurrentMove
+
+ ld hl, TookAimText
+ jp StdBattleTextBox
+
+.fail
+ call AnimateFailedMove
+ jp PrintDidntAffect
+
+; 35a74
diff --git a/engine/battle/move_effects/magnitude.asm b/engine/battle/move_effects/magnitude.asm
new file mode 100644
index 000000000..f56ec5c1b
--- /dev/null
+++ b/engine/battle/move_effects/magnitude.asm
@@ -0,0 +1,29 @@
+BattleCommand_GetMagnitude: ; 37991
+; getmagnitude
+
+ push bc
+ call BattleRandom
+ ld b, a
+ ld hl, MagnitudePower
+.loop
+ ld a, [hli]
+ cp b
+ jr nc, .ok
+ inc hl
+ inc hl
+ jr .loop
+
+.ok
+ ld d, [hl]
+ push de
+ inc hl
+ ld a, [hl]
+ ld [wTypeMatchup], a
+ call BattleCommand_MoveDelay
+ ld hl, MagnitudeText
+ call StdBattleTextBox
+ pop de
+ pop bc
+ ret
+
+INCLUDE "data/moves/magnitude_power.asm"
diff --git a/engine/battle/effect_commands/metronome.asm b/engine/battle/move_effects/metronome.asm
index 1908df84d..6835ab569 100644
--- a/engine/battle/effect_commands/metronome.asm
+++ b/engine/battle/move_effects/metronome.asm
@@ -43,19 +43,4 @@ BattleCommand_Metronome: ; 37418
; 37454
-MetronomeExcepts: ; 37454
- db NO_MOVE
- db METRONOME
- db STRUGGLE
- db SKETCH
- db MIMIC
- db COUNTER
- db MIRROR_COAT
- db PROTECT
- db DETECT
- db ENDURE
- db DESTINY_BOND
- db SLEEP_TALK
- db THIEF
- db -1
-; 37462
+INCLUDE "data/battle/metronome_exception_moves.asm"
diff --git a/engine/battle/move_effects/mimic.asm b/engine/battle/move_effects/mimic.asm
new file mode 100644
index 000000000..712b42df1
--- /dev/null
+++ b/engine/battle/move_effects/mimic.asm
@@ -0,0 +1,52 @@
+BattleCommand_Mimic: ; 36f46
+; mimic
+
+ call ClearLastMove
+ call BattleCommand_MoveDelay
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .fail
+ ld hl, wBattleMonMoves
+ ld a, [hBattleTurn]
+ and a
+ jr z, .player_turn
+ ld hl, wEnemyMonMoves
+.player_turn
+ call CheckHiddenOpponent
+ jr nz, .fail
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ jr z, .fail
+ cp STRUGGLE
+ jr z, .fail
+ ld b, a
+ ld c, NUM_MOVES
+.check_already_knows_move
+ ld a, [hli]
+ cp b
+ jr z, .fail
+ dec c
+ jr nz, .check_already_knows_move
+ dec hl
+.find_mimic
+ ld a, [hld]
+ cp MIMIC
+ jr nz, .find_mimic
+ inc hl
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ ld [hl], a
+ ld [wNamedObjectIndexBuffer], a
+ ld bc, wBattleMonPP - wBattleMonMoves
+ add hl, bc
+ ld [hl], 5
+ call GetMoveName
+ call AnimateCurrentMove
+ ld hl, LearnedMoveText
+ jp StdBattleTextBox
+
+.fail
+ jp FailMimic
+
+; 36f9d
diff --git a/engine/battle/move_effects/mirror_coat.asm b/engine/battle/move_effects/mirror_coat.asm
new file mode 100644
index 000000000..41e296108
--- /dev/null
+++ b/engine/battle/move_effects/mirror_coat.asm
@@ -0,0 +1,61 @@
+BattleCommand_MirrorCoat: ; 37c95
+; mirrorcoat
+
+ ld a, 1
+ ld [wAttackMissed], a
+
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ ret z
+
+ ld b, a
+ callfar GetMoveEffect
+ ld a, b
+ cp EFFECT_MIRROR_COAT
+ ret z
+
+ call BattleCommand_ResetTypeMatchup
+ ld a, [wTypeMatchup]
+ and a
+ ret z
+
+ call CheckOpponentWentFirst
+ ret z
+
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ dec a
+ ld de, wStringBuffer1
+ call GetMoveData
+
+ ld a, [wStringBuffer1 + 2]
+ and a
+ ret z
+
+ ld a, [wStringBuffer1 + 3]
+ cp SPECIAL
+ ret c
+
+ ld hl, wCurDamage
+ ld a, [hli]
+ or [hl]
+ ret z
+
+ ld a, [hl]
+ add a
+ ld [hld], a
+ ld a, [hl]
+ adc a
+ ld [hl], a
+ jr nc, .capped
+ ld a, $ff
+ ld [hli], a
+ ld [hl], a
+.capped
+
+ xor a
+ ld [wAttackMissed], a
+ ret
+
+; 37ce6
diff --git a/engine/battle/effect_commands/mirror_move.asm b/engine/battle/move_effects/mirror_move.asm
index c4f208d77..c4f208d77 100644
--- a/engine/battle/effect_commands/mirror_move.asm
+++ b/engine/battle/move_effects/mirror_move.asm
diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm
new file mode 100644
index 000000000..9ffd86c8e
--- /dev/null
+++ b/engine/battle/move_effects/mist.asm
@@ -0,0 +1,17 @@
+BattleCommand_Mist: ; 36c7e
+; mist
+
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ bit SUBSTATUS_MIST, [hl]
+ jr nz, .already_mist
+ set SUBSTATUS_MIST, [hl]
+ call AnimateCurrentMove
+ ld hl, MistText
+ jp StdBattleTextBox
+
+.already_mist
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+; 36c98
diff --git a/engine/battle/effect_commands/nightmare.asm b/engine/battle/move_effects/nightmare.asm
index 788e3de41..788e3de41 100644
--- a/engine/battle/effect_commands/nightmare.asm
+++ b/engine/battle/move_effects/nightmare.asm
diff --git a/engine/battle/move_effects/pain_split.asm b/engine/battle/move_effects/pain_split.asm
new file mode 100644
index 000000000..2db3726c6
--- /dev/null
+++ b/engine/battle/move_effects/pain_split.asm
@@ -0,0 +1,97 @@
+BattleCommand_PainSplit: ; 35926
+; painsplit
+
+ ld a, [wAttackMissed]
+ and a
+ jp nz, .ButItFailed
+ call CheckSubstituteOpp
+ jp nz, .ButItFailed
+ call AnimateCurrentMove
+ ld hl, wBattleMonMaxHP + 1
+ ld de, wEnemyMonMaxHP + 1
+ call .PlayerShareHP
+ ld a, $1
+ ld [wWhichHPBar], a
+ hlcoord 10, 9
+ predef AnimateHPBar
+ ld hl, wEnemyMonHP
+ ld a, [hli]
+ ld [wBuffer4], a
+ ld a, [hli]
+ ld [wBuffer3], a
+ ld a, [hli]
+ ld [wBuffer2], a
+ ld a, [hl]
+ ld [wBuffer1], a
+ call .EnemyShareHP
+ xor a
+ ld [wWhichHPBar], a
+ call ResetDamage
+ hlcoord 2, 2
+ predef AnimateHPBar
+ farcall _UpdateBattleHUDs
+
+ ld hl, SharedPainText
+ jp StdBattleTextBox
+
+.PlayerShareHP:
+ ld a, [hld]
+ ld [wBuffer1], a
+ ld a, [hld]
+ ld [wBuffer2], a
+ ld a, [hld]
+ ld b, a
+ ld [wBuffer3], a
+ ld a, [hl]
+ ld [wBuffer4], a
+ dec de
+ dec de
+ ld a, [de]
+ dec de
+ add b
+ ld [wCurDamage + 1], a
+ ld b, [hl]
+ ld a, [de]
+ adc b
+ srl a
+ ld [wCurDamage], a
+ ld a, [wCurDamage + 1]
+ rr a
+ ld [wCurDamage + 1], a
+ inc hl
+ inc hl
+ inc hl
+ inc de
+ inc de
+ inc de
+
+.EnemyShareHP: ; 359ac
+ ld c, [hl]
+ dec hl
+ ld a, [wCurDamage + 1]
+ sub c
+ ld b, [hl]
+ dec hl
+ ld a, [wCurDamage]
+ sbc b
+ jr nc, .skip
+
+ ld a, [wCurDamage]
+ ld b, a
+ ld a, [wCurDamage + 1]
+ ld c, a
+.skip
+ ld a, c
+ ld [hld], a
+ ld [wBuffer5], a
+ ld a, b
+ ld [hli], a
+ ld [wBuffer6], a
+ ret
+
+; 359cd
+
+.ButItFailed:
+ jp PrintDidntAffect2
+
+; 359d0
diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm
new file mode 100644
index 000000000..a5d2fed0d
--- /dev/null
+++ b/engine/battle/move_effects/pay_day.asm
@@ -0,0 +1,28 @@
+BattleCommand_PayDay: ; 3705c
+; payday
+
+ xor a
+ ld hl, wStringBuffer1
+ ld [hli], a
+
+ ld a, [hBattleTurn]
+ and a
+ ld a, [wBattleMonLevel]
+ jr z, .ok
+ ld a, [wEnemyMonLevel]
+.ok
+
+ add a
+ ld hl, wPayDayMoney + 2
+ add [hl]
+ ld [hld], a
+ jr nc, .done
+ inc [hl]
+ dec hl
+ jr nz, .done
+ inc [hl]
+.done
+ ld hl, CoinsScatteredText
+ jp StdBattleTextBox
+
+; 3707f
diff --git a/engine/battle/effect_commands/perish_song.asm b/engine/battle/move_effects/perish_song.asm
index 8c88c8739..8c88c8739 100644
--- a/engine/battle/effect_commands/perish_song.asm
+++ b/engine/battle/move_effects/perish_song.asm
diff --git a/engine/battle/effect_commands/present.asm b/engine/battle/move_effects/present.asm
index f0cf8006d..a2ef5bc64 100755
--- a/engine/battle/effect_commands/present.asm
+++ b/engine/battle/move_effects/present.asm
@@ -27,7 +27,7 @@ BattleCommand_Present: ; 37874
push bc
call BattleRandom
ld b, a
- ld hl, .PresentPower
+ ld hl, PresentPower
ld c, 0
.next
ld a, [hli]
@@ -49,7 +49,7 @@ BattleCommand_Present: ; 37874
.heal_effect
pop bc
- ld a, $3
+ ld a, 3
ld [wPresentPower], a
call AnimateCurrentMove
call BattleCommand_SwitchTurn
@@ -85,9 +85,4 @@ BattleCommand_Present: ; 37874
.do_animation
jp EndMoveEffect
-.PresentPower:
- db 40 percent, 40
- db 70 percent + 1, 80
- db 80 percent, 120
- db -1 ; end
-; 3790e
+INCLUDE "data/moves/present_power.asm"
diff --git a/engine/battle/effect_commands/protect.asm b/engine/battle/move_effects/protect.asm
index 6c65e0ed1..6c65e0ed1 100644
--- a/engine/battle/effect_commands/protect.asm
+++ b/engine/battle/move_effects/protect.asm
diff --git a/engine/battle/move_effects/psych_up.asm b/engine/battle/move_effects/psych_up.asm
new file mode 100644
index 000000000..c57fff9cd
--- /dev/null
+++ b/engine/battle/move_effects/psych_up.asm
@@ -0,0 +1,51 @@
+BattleCommand_PsychUp: ; 37c55
+; psychup
+
+ ld hl, wEnemyStatLevels
+ ld de, wPlayerStatLevels
+ ld a, [hBattleTurn]
+ and a
+ jr z, .pointers_correct
+; It's the enemy's turn, so swap the pointers.
+ push hl
+ ld h, d
+ ld l, e
+ pop de
+.pointers_correct
+ push hl
+ ld b, NUM_LEVEL_STATS
+; If any of the enemy's stats is modified from its base level,
+; the move succeeds. Otherwise, it fails.
+.loop
+ ld a, [hli]
+ cp BASE_STAT_LEVEL
+ jr nz, .break
+ dec b
+ jr nz, .loop
+ pop hl
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+.break
+ pop hl
+ ld b, NUM_LEVEL_STATS
+.loop2
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .loop2
+ ld a, [hBattleTurn]
+ and a
+ jr nz, .calc_enemy_stats
+ call CalcPlayerStats
+ jr .merge
+
+.calc_enemy_stats
+ call CalcEnemyStats
+.merge
+ call AnimateCurrentMove
+ ld hl, CopiedStatsText
+ jp StdBattleTextBox
+
+; 37c95
diff --git a/engine/battle/move_effects/pursuit.asm b/engine/battle/move_effects/pursuit.asm
new file mode 100644
index 000000000..969e08f73
--- /dev/null
+++ b/engine/battle/move_effects/pursuit.asm
@@ -0,0 +1,26 @@
+BattleCommand_Pursuit: ; 37b1d
+; pursuit
+; Double damage if the opponent is switching.
+
+ ld hl, wEnemyIsSwitching
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld hl, wPlayerIsSwitching
+.ok
+ ld a, [hl]
+ and a
+ ret z
+
+ ld hl, wCurDamage + 1
+ sla [hl]
+ dec hl
+ rl [hl]
+ ret nc
+
+ ld a, $ff
+ ld [hli], a
+ ld [hl], a
+ ret
+
+; 37b39
diff --git a/engine/battle/move_effects/rage.asm b/engine/battle/move_effects/rage.asm
new file mode 100644
index 000000000..ac01f8137
--- /dev/null
+++ b/engine/battle/move_effects/rage.asm
@@ -0,0 +1,8 @@
+BattleCommand_Rage: ; 36f1d
+; rage
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ set SUBSTATUS_RAGE, [hl]
+ ret
+
+; 36f25
diff --git a/engine/battle/move_effects/rain_dance.asm b/engine/battle/move_effects/rain_dance.asm
new file mode 100644
index 000000000..6c587d551
--- /dev/null
+++ b/engine/battle/move_effects/rain_dance.asm
@@ -0,0 +1,11 @@
+BattleCommand_StartRain: ; 37bf4
+; startrain
+ ld a, WEATHER_RAIN
+ ld [wBattleWeather], a
+ ld a, 5
+ ld [wWeatherCount], a
+ call AnimateCurrentMove
+ ld hl, DownpourText
+ jp StdBattleTextBox
+
+; 37c07
diff --git a/engine/battle/move_effects/rapid_spin.asm b/engine/battle/move_effects/rapid_spin.asm
new file mode 100644
index 000000000..84bcbad7f
--- /dev/null
+++ b/engine/battle/move_effects/rapid_spin.asm
@@ -0,0 +1,38 @@
+BattleCommand_ClearHazards: ; 37b39
+; clearhazards
+
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ bit SUBSTATUS_LEECH_SEED, [hl]
+ jr z, .not_leeched
+ res SUBSTATUS_LEECH_SEED, [hl]
+ ld hl, ShedLeechSeedText
+ call StdBattleTextBox
+.not_leeched
+
+ ld hl, wPlayerScreens
+ ld de, wPlayerWrapCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_screens_wrap
+ ld hl, wEnemyScreens
+ ld de, wEnemyWrapCount
+.got_screens_wrap
+ bit SCREENS_SPIKES, [hl]
+ jr z, .no_spikes
+ res SCREENS_SPIKES, [hl]
+ ld hl, BlewSpikesText
+ push de
+ call StdBattleTextBox
+ pop de
+.no_spikes
+
+ ld a, [de]
+ and a
+ ret z
+ xor a
+ ld [de], a
+ ld hl, ReleasedByText
+ jp StdBattleTextBox
+
+; 37b74
diff --git a/engine/battle/move_effects/return.asm b/engine/battle/move_effects/return.asm
new file mode 100644
index 000000000..e1d568e7c
--- /dev/null
+++ b/engine/battle/move_effects/return.asm
@@ -0,0 +1,27 @@
+BattleCommand_HappinessPower: ; 3784b
+; happinesspower
+ push bc
+ ld hl, wBattleMonHappiness
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld hl, wEnemyMonHappiness
+.ok
+ xor a
+ ld [hMultiplicand + 0], a
+ ld [hMultiplicand + 1], a
+ ld a, [hl]
+ ld [hMultiplicand + 2], a
+ ld a, 10
+ ld [hMultiplier], a
+ call Multiply
+ ld a, 25
+ ld [hDivisor], a
+ ld b, 4
+ call Divide
+ ld a, [hQuotient + 2]
+ ld d, a
+ pop bc
+ ret
+
+; 37874
diff --git a/engine/battle/effect_commands/rollout.asm b/engine/battle/move_effects/rollout.asm
index f6966c48a..f6966c48a 100644
--- a/engine/battle/effect_commands/rollout.asm
+++ b/engine/battle/move_effects/rollout.asm
diff --git a/engine/battle/move_effects/safeguard.asm b/engine/battle/move_effects/safeguard.asm
new file mode 100644
index 000000000..1dc233eab
--- /dev/null
+++ b/engine/battle/move_effects/safeguard.asm
@@ -0,0 +1,25 @@
+BattleCommand_Safeguard: ; 37939
+; safeguard
+
+ ld hl, wPlayerScreens
+ ld de, wPlayerSafeguardCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .ok
+ ld hl, wEnemyScreens
+ ld de, wEnemySafeguardCount
+.ok
+ bit SCREENS_SAFEGUARD, [hl]
+ jr nz, .failed
+ set SCREENS_SAFEGUARD, [hl]
+ ld a, 5
+ ld [de], a
+ call AnimateCurrentMove
+ ld hl, CoveredByVeilText
+ jp StdBattleTextBox
+
+.failed
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+; 37962
diff --git a/engine/battle/effect_commands/sandstorm.asm b/engine/battle/move_effects/sandstorm.asm
index 5aaa61deb..5aaa61deb 100644
--- a/engine/battle/effect_commands/sandstorm.asm
+++ b/engine/battle/move_effects/sandstorm.asm
diff --git a/engine/battle/move_effects/selfdestruct.asm b/engine/battle/move_effects/selfdestruct.asm
new file mode 100644
index 000000000..6f6b0966f
--- /dev/null
+++ b/engine/battle/move_effects/selfdestruct.asm
@@ -0,0 +1,31 @@
+BattleCommand_Selfdestruct: ; 37380
+ farcall StubbedTrainerRankings_Selfdestruct
+ ld a, BATTLEANIM_PLAYER_DAMAGE
+ ld [wNumHits], a
+ ld c, 3
+ call DelayFrames
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVarAddr
+ xor a
+ ld [hli], a
+ inc hl
+ ld [hli], a
+ ld [hl], a
+ ld a, $1
+ ld [wKickCounter], a
+ call BattleCommand_LowerSub
+ call LoadMoveAnim
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ res SUBSTATUS_LEECH_SEED, [hl]
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVarAddr
+ res SUBSTATUS_DESTINY_BOND, [hl]
+ call _CheckBattleScene
+ ret nc
+ farcall DrawPlayerHUD
+ farcall DrawEnemyHUD
+ call WaitBGMap
+ jp RefreshBattleHuds
+
+; 373c9
diff --git a/engine/battle/move_effects/sketch.asm b/engine/battle/move_effects/sketch.asm
new file mode 100644
index 000000000..93f7ff30c
--- /dev/null
+++ b/engine/battle/move_effects/sketch.asm
@@ -0,0 +1,119 @@
+BattleCommand_Sketch: ; 35a74
+; sketch
+
+ call ClearLastMove
+; Don't sketch during a link battle
+ ld a, [wLinkMode]
+ and a
+ jr z, .not_linked
+ call AnimateFailedMove
+ jp PrintNothingHappened
+
+.not_linked
+; If the opponent has a substitute up, fail.
+ call CheckSubstituteOpp
+ jp nz, .fail
+; If the opponent is transformed, fail.
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVarAddr
+ bit SUBSTATUS_TRANSFORMED, [hl]
+ jp nz, .fail
+; Get the user's moveset in its party struct.
+; This move replacement shall be permanent.
+; Pointer will be in de.
+ ld a, MON_MOVES
+ call UserPartyAttr
+ ld d, h
+ ld e, l
+; Get the battle move structs.
+ ld hl, wBattleMonMoves
+ ld a, [hBattleTurn]
+ and a
+ jr z, .get_last_move
+ ld hl, wEnemyMonMoves
+.get_last_move
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ ld [wTypeMatchup], a
+ ld b, a
+; Fail if move is invalid or is Struggle.
+ and a
+ jr z, .fail
+ cp STRUGGLE
+ jr z, .fail
+; Fail if user already knows that move
+ ld c, NUM_MOVES
+.does_user_already_know_move
+ ld a, [hli]
+ cp b
+ jr z, .fail
+ dec c
+ jr nz, .does_user_already_know_move
+; Find Sketch in the user's moveset.
+; Pointer in hl, and index in c.
+ dec hl
+ ld c, NUM_MOVES
+.find_sketch
+ dec c
+ ld a, [hld]
+ cp SKETCH
+ jr nz, .find_sketch
+ inc hl
+; The Sketched move is loaded to that slot.
+ ld a, b
+ ld [hl], a
+; Copy the base PP from that move.
+ push bc
+ push hl
+ dec a
+ ld hl, Moves + MOVE_PP
+ call GetMoveAttr
+ pop hl
+ ld bc, wBattleMonPP - wBattleMonMoves
+ add hl, bc
+ ld [hl], a
+ pop bc
+
+ ld a, [hBattleTurn]
+ and a
+ jr z, .user_trainer
+ ld a, [wBattleMode]
+ dec a
+ jr nz, .user_trainer
+; wildmon
+ ld a, [hl]
+ push bc
+ ld hl, wWildMonPP
+ ld b, 0
+ add hl, bc
+ ld [hl], a
+ ld hl, wWildMonMoves
+ add hl, bc
+ pop bc
+ ld [hl], b
+ jr .done_copy
+
+.user_trainer
+ ld a, [hl]
+ push af
+ ld l, c
+ ld h, 0
+ add hl, de
+ ld a, b
+ ld [hl], a
+ pop af
+ ld de, MON_PP - MON_MOVES
+ add hl, de
+ ld [hl], a
+.done_copy
+ call GetMoveName
+ call AnimateCurrentMove
+
+ ld hl, SketchedText
+ jp StdBattleTextBox
+
+.fail
+ call AnimateFailedMove
+ jp PrintDidntAffect
+
+; 35b16
diff --git a/engine/battle/move_effects/sleep_talk.asm b/engine/battle/move_effects/sleep_talk.asm
new file mode 100644
index 000000000..3f62d4e36
--- /dev/null
+++ b/engine/battle/move_effects/sleep_talk.asm
@@ -0,0 +1,145 @@
+BattleCommand_SleepTalk: ; 35b33
+; sleeptalk
+
+ call ClearLastMove
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .fail
+ ld a, [hBattleTurn]
+ and a
+ ld hl, wBattleMonMoves + 1
+ ld a, [wDisabledMove]
+ ld d, a
+ jr z, .got_moves
+ ld hl, wEnemyMonMoves + 1
+ ld a, [wEnemyDisabledMove]
+ ld d, a
+.got_moves
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVar
+ and SLP
+ jr z, .fail
+ ld a, [hl]
+ and a
+ jr z, .fail
+ call .safely_check_has_usable_move
+ jr c, .fail
+ dec hl
+.sample_move
+ push hl
+ call BattleRandom
+ maskbits NUM_MOVES
+ ld c, a
+ ld b, 0
+ add hl, bc
+ ld a, [hl]
+ pop hl
+ and a
+ jr z, .sample_move
+ ld e, a
+ ld a, BATTLE_VARS_MOVE_ANIM
+ call GetBattleVar
+ cp e
+ jr z, .sample_move
+ ld a, e
+ cp d
+ jr z, .sample_move
+ call .check_two_turn_move
+ jr z, .sample_move
+ ld a, BATTLE_VARS_MOVE
+ call GetBattleVarAddr
+ ld a, e
+ ld [hl], a
+ call CheckUserIsCharging
+ jr nz, .charging
+ ld a, [wKickCounter]
+ push af
+ call BattleCommand_LowerSub
+ pop af
+ ld [wKickCounter], a
+.charging
+ call LoadMoveAnim
+ call UpdateMoveData
+ jp ResetTurn
+
+.fail
+ call AnimateFailedMove
+ jp TryPrintButItFailed
+
+.safely_check_has_usable_move
+ push hl
+ push de
+ push bc
+ call .check_has_usable_move
+ pop bc
+ pop de
+ pop hl
+ ret
+
+.check_has_usable_move
+ ld a, [hBattleTurn]
+ and a
+ ld a, [wDisabledMove]
+ jr z, .got_move_2
+
+ ld a, [wEnemyDisabledMove]
+.got_move_2
+ ld b, a
+ ld a, BATTLE_VARS_MOVE
+ call GetBattleVar
+ ld c, a
+ dec hl
+ ld d, NUM_MOVES
+.loop2
+ ld a, [hl]
+ and a
+ jr z, .carry
+
+ cp c
+ jr z, .nope
+ cp b
+ jr z, .nope
+
+ call .check_two_turn_move
+ jr nz, .no_carry
+
+.nope
+ inc hl
+ dec d
+ jr nz, .loop2
+
+.carry
+ scf
+ ret
+
+.no_carry
+ and a
+ ret
+
+.check_two_turn_move
+ push hl
+ push de
+ push bc
+
+ ld b, a
+ callfar GetMoveEffect
+ ld a, b
+
+ pop bc
+ pop de
+ pop hl
+
+ cp EFFECT_SKULL_BASH
+ ret z
+ cp EFFECT_RAZOR_WIND
+ ret z
+ cp EFFECT_SKY_ATTACK
+ ret z
+ cp EFFECT_SOLARBEAM
+ ret z
+ cp EFFECT_FLY
+ ret z
+ cp EFFECT_BIDE
+ ret
+
+; 35bff
diff --git a/engine/battle/move_effects/snore.asm b/engine/battle/move_effects/snore.asm
new file mode 100644
index 000000000..49fb1b210
--- /dev/null
+++ b/engine/battle/move_effects/snore.asm
@@ -0,0 +1,13 @@
+BattleCommand_Snore: ; 359d0
+; snore
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVar
+ and SLP
+ ret nz
+ call ResetDamage
+ ld a, $1
+ ld [wAttackMissed], a
+ call FailMove
+ jp EndMoveEffect
+
+; 359e6
diff --git a/engine/battle/effect_commands/spikes.asm b/engine/battle/move_effects/spikes.asm
index a5e22a706..6cab0b96f 100644
--- a/engine/battle/effect_commands/spikes.asm
+++ b/engine/battle/move_effects/spikes.asm
@@ -23,5 +23,5 @@ BattleCommand_Spikes: ; 37683
jp StdBattleTextBox
.failed
- jp FailSpikes
+ jp FailMove
; 376a0
diff --git a/engine/battle/move_effects/spite.asm b/engine/battle/move_effects/spite.asm
new file mode 100644
index 000000000..30a908ae7
--- /dev/null
+++ b/engine/battle/move_effects/spite.asm
@@ -0,0 +1,88 @@
+BattleCommand_Spite: ; 35c0f
+; spite
+
+ ld a, [wAttackMissed]
+ and a
+ jp nz, .failed
+ ld bc, PARTYMON_STRUCT_LENGTH ; ????
+ ld hl, wEnemyMonMoves
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_moves
+ ld hl, wBattleMonMoves
+.got_moves
+ ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
+ call GetBattleVar
+ and a
+ jr z, .failed
+ cp STRUGGLE
+ jr z, .failed
+ ld b, a
+ ld c, -1
+.loop
+ inc c
+ ld a, [hli]
+ cp b
+ jr nz, .loop
+ ld [wTypeMatchup], a
+ dec hl
+ ld b, 0
+ push bc
+ ld c, wBattleMonPP - wBattleMonMoves
+ add hl, bc
+ pop bc
+ ld a, [hl]
+ and PP_MASK
+ jr z, .failed
+ push bc
+ call GetMoveName
+ ; lose 2-5 PP
+ call BattleRandom
+ and %11
+ inc a
+ inc a
+ ld b, a
+ ld a, [hl]
+ and PP_MASK
+ cp b
+ jr nc, .deplete_pp
+ ld b, a
+.deplete_pp
+ ld a, [hl]
+ sub b
+ ld [hl], a
+ push af
+ ld a, MON_PP
+ call OpponentPartyAttr
+ ld d, b
+ pop af
+ pop bc
+ add hl, bc
+ ld e, a
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVar
+ bit SUBSTATUS_TRANSFORMED, a
+ jr nz, .transformed
+ ld a, [hBattleTurn]
+ and a
+ jr nz, .not_wildmon
+ ld a, [wBattleMode]
+ dec a
+ jr nz, .not_wildmon
+ ld hl, wWildMonPP
+ add hl, bc
+.not_wildmon
+ ld [hl], e
+.transformed
+ push de
+ call AnimateCurrentMove
+ pop de
+ ld a, d
+ ld [wTypeMatchup], a
+ ld hl, SpiteEffectText
+ jp StdBattleTextBox
+
+.failed
+ jp PrintDidntAffect2
+
+; 35c94
diff --git a/engine/battle/move_effects/splash.asm b/engine/battle/move_effects/splash.asm
new file mode 100644
index 000000000..5b5e504b8
--- /dev/null
+++ b/engine/battle/move_effects/splash.asm
@@ -0,0 +1,6 @@
+BattleCommand_Splash: ; 36fe1
+ call AnimateCurrentMove
+ farcall StubbedTrainerRankings_Splash
+ jp PrintNothingHappened
+
+; 36fed
diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm
new file mode 100644
index 000000000..1deaa848d
--- /dev/null
+++ b/engine/battle/move_effects/substitute.asm
@@ -0,0 +1,90 @@
+BattleCommand_Substitute: ; 36e7c
+; substitute
+
+ call BattleCommand_MoveDelay
+ ld hl, wBattleMonMaxHP
+ ld de, wPlayerSubstituteHP
+ ld a, [hBattleTurn]
+ and a
+ jr z, .got_hp
+ ld hl, wEnemyMonMaxHP
+ ld de, wEnemySubstituteHP
+.got_hp
+
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVar
+ bit SUBSTATUS_SUBSTITUTE, a
+ jr nz, .already_has_sub
+
+ ld a, [hli]
+ ld b, [hl]
+ srl a
+ rr b
+ srl a
+ rr b
+ dec hl
+ dec hl
+ ld a, b
+ ld [de], a
+ ld a, [hld]
+ sub b
+ ld e, a
+ ld a, [hl]
+ sbc 0
+ ld d, a
+ jr c, .too_weak_to_sub
+ ld a, d
+ or e
+ jr z, .too_weak_to_sub
+ ld [hl], d
+ inc hl
+ ld [hl], e
+
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ set SUBSTATUS_SUBSTITUTE, [hl]
+
+ ld hl, wPlayerWrapCount
+ ld de, wPlayerTrappingMove
+ ld a, [hBattleTurn]
+ and a
+ jr z, .player
+ ld hl, wEnemyWrapCount
+ ld de, wEnemyTrappingMove
+.player
+
+ xor a
+ ld [hl], a
+ ld [de], a
+ call _CheckBattleScene
+ jr c, .no_anim
+
+ xor a
+ ld [wNumHits], a
+ ld [wFXAnimID + 1], a
+ ld [wKickCounter], a
+ ld a, SUBSTITUTE
+ call LoadAnim
+ jr .finish
+
+.no_anim
+ call BattleCommand_RaiseSubNoAnim
+.finish
+ ld hl, MadeSubstituteText
+ call StdBattleTextBox
+ jp RefreshBattleHuds
+
+.already_has_sub
+ call CheckUserIsCharging
+ call nz, BattleCommand_RaiseSub
+ ld hl, HasSubstituteText
+ jr .jp_stdbattletextbox
+
+.too_weak_to_sub
+ call CheckUserIsCharging
+ call nz, BattleCommand_RaiseSub
+ ld hl, TooWeakSubText
+.jp_stdbattletextbox
+ jp StdBattleTextBox
+
+; 36f0b
diff --git a/engine/battle/move_effects/sunny_day.asm b/engine/battle/move_effects/sunny_day.asm
new file mode 100644
index 000000000..ef8c37c5c
--- /dev/null
+++ b/engine/battle/move_effects/sunny_day.asm
@@ -0,0 +1,11 @@
+BattleCommand_StartSun: ; 37c07
+; startsun
+ ld a, WEATHER_SUN
+ ld [wBattleWeather], a
+ ld a, 5
+ ld [wWeatherCount], a
+ call AnimateCurrentMove
+ ld hl, SunGotBrightText
+ jp StdBattleTextBox
+
+; 37c1a
diff --git a/engine/battle/move_effects/teleport.asm b/engine/battle/move_effects/teleport.asm
new file mode 100644
index 000000000..1bd1eb725
--- /dev/null
+++ b/engine/battle/move_effects/teleport.asm
@@ -0,0 +1,91 @@
+BattleCommand_Teleport: ; 36778
+; teleport
+
+ ld a, [wBattleType]
+ cp BATTLETYPE_SHINY
+ jr z, .failed
+ cp BATTLETYPE_TRAP
+ jr z, .failed
+ cp BATTLETYPE_CELEBI
+ jr z, .failed
+ cp BATTLETYPE_SUICUNE
+ jr z, .failed
+
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVar
+ bit SUBSTATUS_CANT_RUN, a
+ jr nz, .failed
+; Only need to check these next things if it's your turn
+ ld a, [hBattleTurn]
+ and a
+ jr nz, .enemy_turn
+; Can't teleport from a trainer battle
+ ld a, [wBattleMode]
+ dec a
+ jr nz, .failed
+; If your level is greater than the opponent's, you run without fail.
+ ld a, [wCurPartyLevel]
+ ld b, a
+ ld a, [wBattleMonLevel]
+ cp b
+ jr nc, .run_away
+; Generate a number between 0 and (YourLevel + TheirLevel).
+ add b
+ ld c, a
+ inc c
+.loop_player
+ call BattleRandom
+ cp c
+ jr nc, .loop_player
+; If that number is greater than 4 times your level, run away.
+ srl b
+ srl b
+ cp b
+ jr nc, .run_away
+
+.failed
+ call AnimateFailedMove
+ jp PrintButItFailed
+
+.enemy_turn
+ ld a, [wBattleMode]
+ dec a
+ jr nz, .failed
+ ld a, [wBattleMonLevel]
+ ld b, a
+ ld a, [wCurPartyLevel]
+ cp b
+ jr nc, .run_away
+ add b
+ ld c, a
+ inc c
+.loop_enemy
+ call BattleRandom
+ cp c
+ jr nc, .loop_enemy
+ srl b
+ srl b
+ cp b
+ ; This does the wrong thing. What was
+ ; probably intended was jr c, .failed
+ ; The way this is made makes enemy use
+ ; of Teleport always succeed if able
+ jr nc, .run_away
+.run_away
+ call UpdateBattleMonInParty
+ xor a
+ ld [wNumHits], a
+ inc a
+ ld [wForcedSwitch], a
+ ld [wKickCounter], a
+ call SetBattleDraw
+ call BattleCommand_LowerSub
+ call LoadMoveAnim
+ ld c, 20
+ call DelayFrames
+ call SetBattleDraw
+
+ ld hl, FledFromBattleText
+ jp StdBattleTextBox
+
+; 36804
diff --git a/engine/battle/effect_commands/thief.asm b/engine/battle/move_effects/thief.asm
index 5397c2bdf..5397c2bdf 100644
--- a/engine/battle/effect_commands/thief.asm
+++ b/engine/battle/move_effects/thief.asm
diff --git a/engine/battle/move_effects/thunder.asm b/engine/battle/move_effects/thunder.asm
new file mode 100644
index 000000000..3705e1a28
--- /dev/null
+++ b/engine/battle/move_effects/thunder.asm
@@ -0,0 +1,20 @@
+BattleCommand_ThunderAccuracy: ; 37d94
+; thunderaccuracy
+
+ ld a, BATTLE_VARS_MOVE_TYPE
+ call GetBattleVarAddr
+ inc hl
+ ld a, [wBattleWeather]
+ cp WEATHER_RAIN
+ jr z, .rain
+ cp WEATHER_SUN
+ ret nz
+ ld [hl], 50 percent + 1
+ ret
+
+.rain
+ ; Redundant with CheckHit guranteeing hit
+ ld [hl], 100 percent
+ ret
+
+; 37daa
diff --git a/engine/battle/effect_commands/transform.asm b/engine/battle/move_effects/transform.asm
index 5ae7c1511..5ae7c1511 100755
--- a/engine/battle/effect_commands/transform.asm
+++ b/engine/battle/move_effects/transform.asm
diff --git a/engine/battle/move_effects/triple_kick.asm b/engine/battle/move_effects/triple_kick.asm
new file mode 100644
index 000000000..cef56a1ae
--- /dev/null
+++ b/engine/battle/move_effects/triple_kick.asm
@@ -0,0 +1,39 @@
+BattleCommand_TripleKick: ; 346b2
+; triplekick
+
+ ld a, [wKickCounter]
+ ld b, a
+ inc b
+ ld hl, wCurDamage + 1
+ ld a, [hld]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+.next_kick
+ dec b
+ ret z
+ ld a, [hl]
+ add e
+ ld [hld], a
+ ld a, [hl]
+ adc d
+ ld [hli], a
+
+; No overflow.
+ jr nc, .next_kick
+ ld a, $ff
+ ld [hld], a
+ ld [hl], a
+ ret
+
+; 346cd
+
+
+BattleCommand_KickCounter: ; 346cd
+; kickcounter
+
+ ld hl, wKickCounter
+ inc [hl]
+ ret
+
+; 346d2
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index 9f7a4a4a8..3227236c1 100755
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -44,7 +44,7 @@ ReadTrainerParty: ; 39771
jr z, .got_trainer
.loop
ld a, [hli]
- cp $ff
+ cp -1
jr nz, .loop
jr .skip_trainer
.got_trainer
@@ -82,6 +82,7 @@ ReadTrainerParty: ; 39771
; 397e3
TrainerTypes: ; 397e3
+; entries correspond to TRAINERTYPE_* constants
dw TrainerType1 ; level, species
dw TrainerType2 ; level, species, moves
dw TrainerType3 ; level, species, item
diff --git a/engine/battle/returntobattle_useball.asm b/engine/battle/returntobattle_useball.asm
index b63881b2c..952239f94 100644
--- a/engine/battle/returntobattle_useball.asm
+++ b/engine/battle/returntobattle_useball.asm
@@ -14,6 +14,6 @@ _ReturnToBattle_UseBall: ; 2715c
farcall _LoadBattleFontsHPBar
call GetMemSGBLayout
call CloseWindow
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call WaitBGMap
jp SetPalettes
diff --git a/engine/battle/used_move_text.asm b/engine/battle/used_move_text.asm
index bab0ea834..f2182f378 100755
--- a/engine/battle/used_move_text.asm
+++ b/engine/battle/used_move_text.asm
@@ -114,6 +114,7 @@ MoveNameText: ; 105e23
; 105e39
.endusedmovetexts ; 105e39
+; entries correspond to MoveGrammar sets
dw EndUsedMove1Text
dw EndUsedMove2Text
dw EndUsedMove3Text
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index ca4928233..43e28c5db 100644
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -263,7 +263,7 @@ BattleAnim_ClearCGB_OAMFlags: ; cc23d
ld a, [hl]
and $f0
ld [hli], a
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
dec c
diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm
index e747feeef..0e0561b58 100755
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -1749,6 +1749,7 @@ Functioncd9f4: ; cd9f4 (33:59f4)
Unknown_cda01: ; cda01
db 8, 6, 5, 4, 5, 6, 8, 12, 16
; cda0a
+
BattleAnimFunction_1C: ; cda0a (33:5a0a)
ld hl, BATTLEANIMSTRUCT_XCOORD
add hl, bc
@@ -2476,6 +2477,7 @@ Functioncde21: ; cde21 (33:5e21)
Unknown_cde25: ; cde25
db $ec, $f8, $00
; cde28
+
BattleAnimFunction_25: ; cde28 (33:5e28)
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
@@ -3279,6 +3281,7 @@ Unknown_ce2c4: ; ce2c4
Unknown_ce2c8: ; ce2c8
db $ff, $ff, $00, $00
; ce2cc
+
BattleAnimFunction_33: ; ce2cc (33:62cc)
ld hl, BATTLEANIMSTRUCT_0B
add hl, bc
@@ -4154,5 +4157,5 @@ BattleAnim_AbsCosinePrecise: ; ce778
; ce77f
BattleAnimSineWave: ; ce77f
- sine_wave $100
+ sine_wave 32
; ce7bf
diff --git a/engine/battle_anims/getpokeballwobble.asm b/engine/battle_anims/getpokeballwobble.asm
index b3f558039..d85240f08 100755
--- a/engine/battle_anims/getpokeballwobble.asm
+++ b/engine/battle_anims/getpokeballwobble.asm
@@ -24,7 +24,7 @@ GetPokeBallWobble: ; f971 (3:7971)
ld c, 0 ; next
jr nz, .done
- ld hl, .WobbleProbabilities
+ ld hl, WobbleProbabilities
ld a, [wBuffer1]
ld b, a
.loop
@@ -59,30 +59,4 @@ GetPokeBallWobble: ; f971 (3:7971)
pop de
ret
-.WobbleProbabilities: ; f9ba
-; catch rate, chance of wobbling / 255
-; nLeft/255 = (nRight/255) ** 4
- db 1, 63
- db 2, 75
- db 3, 84
- db 4, 90
- db 5, 95
- db 7, 103
- db 10, 113
- db 15, 126
- db 20, 134
- db 30, 149
- db 40, 160
- db 50, 169
- db 60, 177
- db 80, 191
- db 100, 201
- db 120, 211
- db 140, 220
- db 160, 227
- db 180, 234
- db 200, 240
- db 220, 246
- db 240, 251
- db 254, 253
- db 255, 255
+INCLUDE "data/battle/wobble_probabilities.asm"
diff --git a/engine/billspc.asm b/engine/billspc.asm
index 57c4faac4..acf286b89 100755
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -128,8 +128,8 @@ _DepositPKMN: ; e2391 (38:6391)
ret
.Submenu: ; e247d (38:647d)
- ld hl, BillsPCDepositMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, BillsPCDepositMenuHeader
+ call CopyMenuHeader
ld a, [wMenuCursorY]
call StoreTo_wMenuCursorBuffer
call VerticalMenu
@@ -172,7 +172,7 @@ BillsPCDepositFuncDeposit: ; e24a9 (38:64a9)
ret
BillsPCDepositFuncStats: ; e24c8 (38:64c8)
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call BillsPC_StatsScreen
call ExitMenu
call PCMonInfo
@@ -191,7 +191,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
push af
ld de, PCString_ReleasePKMN
call BillsPC_PlaceString
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
lb bc, 14, 11
call PlaceYesNoBox
ld a, [wMenuCursorY]
@@ -228,14 +228,14 @@ BillsPCDepositFuncCancel: ; e2537 (38:6537)
ret
; e253d (38:653d)
-BillsPCDepositMenuDataHeader: ; 0xe253d (38:653d)
+BillsPCDepositMenuHeader: ; 0xe253d (38:653d)
db MENU_BACKUP_TILES ; flags
menu_coords 9, 4, SCREEN_WIDTH - 1, 13
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0xe2545
-.MenuData2: ; 0xe2545 (38:6545)
+.MenuData: ; 0xe2545 (38:6545)
db STATICMENU_CURSOR ; flags
db 4 ; items
db "DEPOSIT@"
@@ -391,8 +391,8 @@ _WithdrawPKMN: ; e2583 (38:6583)
ret
BillsPC_Withdraw: ; e2675 (38:6675)
- ld hl, .MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .MenuHeader
+ call CopyMenuHeader
ld a, [wMenuCursorY]
call StoreTo_wMenuCursorBuffer
call VerticalMenu
@@ -434,7 +434,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
ret
.stats ; e26c0 (38:66c0)
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call BillsPC_StatsScreen
call ExitMenu
call PCMonInfo
@@ -451,7 +451,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
jr c, .FailedRelease
ld de, PCString_ReleasePKMN
call BillsPC_PlaceString
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
lb bc, 14, 11
call PlaceYesNoBox
ld a, [wMenuCursorY]
@@ -487,7 +487,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
ret
; e2731 (38:6731)
-.MenuDataHeader: ; 0xe2731
+.MenuHeader: ; 0xe2731
db MENU_BACKUP_TILES ; flags
menu_coords 9, 4, SCREEN_WIDTH - 1, 13
dw .MenuData
@@ -652,8 +652,8 @@ _MovePKMNWithoutMail: ; e2759
; e285d
.MoveMonWOMailSubmenu: ; e285d
- ld hl, .MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .MenuHeader
+ call CopyMenuHeader
ld a, [wMenuCursorY]
call StoreTo_wMenuCursorBuffer
call VerticalMenu
@@ -693,7 +693,7 @@ _MovePKMNWithoutMail: ; e2759
; e28a5
.Stats: ; e28a5
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call BillsPC_StatsScreen
call ExitMenu
call PCMonInfo
@@ -710,14 +710,14 @@ _MovePKMNWithoutMail: ; e2759
ret
; e28c3
-.MenuDataHeader: ; 0xe28c3
+.MenuHeader: ; 0xe28c3
db MENU_BACKUP_TILES ; flags
menu_coords 9, 4, SCREEN_WIDTH - 1, 13
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0xe28cb
-.MenuData2: ; 0xe28cb
+.MenuData: ; 0xe28cb
db STATICMENU_CURSOR ; flags
db 3 ; items
db "MOVE@"
@@ -1510,7 +1510,7 @@ BillsPC_UpdateSelectionCursor: ; e2e01 (38:6e01)
inc hl
ld [de], a ; y
inc de
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
ld a, [hli]
ld [de], a
inc de
@@ -1560,7 +1560,7 @@ BillsPC_UpdateInsertCursor: ; e2e8c
inc hl
ld [de], a ; y
inc de
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
ld a, [hli]
ld [de], a
inc de
@@ -2293,15 +2293,15 @@ PCString_NoReleasingEGGS: db "No releasing EGGS!@"
_ChangeBox: ; e35aa (38:75aa)
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call BillsPC_ClearTilemap
.loop
xor a
ld [hBGMapMode], a
call BillsPC_PrintBoxName
call BillsPC_PlaceChooseABoxString
- ld hl, _ChangeBox_menudataheader
- call CopyMenuDataHeader
+ ld hl, _ChangeBox_MenuHeader
+ call CopyMenuHeader
xor a
ld [wMenuScrollPosition], a
hlcoord 0, 4
@@ -2328,14 +2328,14 @@ BillsPC_ClearTilemap: ; e35e2 (38:75e2)
ret
; e35f1 (38:75f1)
-_ChangeBox_menudataheader: ; 0xe35f1
+_ChangeBox_MenuHeader: ; 0xe35f1
db MENU_BACKUP_TILES ; flags
menu_coords 1, 5, 9, 12
- dw .menudata2
+ dw .MenuData
db 1 ; default option
; 0xe35f9
-.menudata2 ; 0xe35f9
+.MenuData ; 0xe35f9
db MENU_UNUSED_1 | MENU_UNUSED_3 ; flags
db 4, 0
db 1
@@ -2487,8 +2487,8 @@ BillsPC_PrintBoxName: ; e36cf (38:76cf)
; e36f9
BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
ret c
@@ -2556,14 +2556,14 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
hlcoord 11, 7 ; unused
-.MenuDataHeader: ; 0xe377b
+.MenuHeader: ; 0xe377b
db MENU_BACKUP_TILES ; flags
menu_coords 11, 4, SCREEN_WIDTH - 1, 13
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0xe3783
-.MenuData2: ; 0xe3783
+.MenuData: ; 0xe3783
db STATICMENU_CURSOR ; flags
db 4 ; items
db "SWITCH@"
diff --git a/engine/billspctop.asm b/engine/billspctop.asm
index 2c0a110ba..0c8064278 100755
--- a/engine/billspctop.asm
+++ b/engine/billspctop.asm
@@ -22,7 +22,7 @@ _BillsPC: ; e3fd
.LogIn: ; e41c (3:641c)
xor a
ld [hBGMapMode], a
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearPCItemScreen
ld hl, wOptions
ld a, [hl]
@@ -45,8 +45,8 @@ _BillsPC: ; e3fd
ret
.UseBillsPC: ; e443 (3:6443)
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
ld a, $1
.loop
ld [wMenuCursorBuffer], a
@@ -68,13 +68,13 @@ _BillsPC: ; e3fd
call CloseWindow
ret
-.MenuDataHeader: ; 0xe46f
+.MenuHeader: ; 0xe46f
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
-.MenuData2: ; 0xe477
+.MenuData: ; 0xe477
db STATICMENU_CURSOR ; flags
db 0 ; items
dw .items
@@ -109,7 +109,7 @@ BillsPC_SeeYa: ; e4cb
ret
BillsPC_MovePKMNMenu: ; e4cd
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall IsAnyMonHoldingMail
jr nc, .no_mail
ld hl, .Text_MonHoldingMail
@@ -134,7 +134,7 @@ BillsPC_MovePKMNMenu: ; e4cd
db "@"
BillsPC_DepositMenu: ; e4fe (3:64fe)
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall _DepositPKMN
call ReturnToMapFromSubmenu
call ClearPCItemScreen
@@ -203,7 +203,7 @@ CheckCurPartyMonFainted: ; e538
ret
BillsPC_WithdrawMenu: ; e559 (3:6559)
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall _WithdrawPKMN
call ReturnToMapFromSubmenu
call ClearPCItemScreen
diff --git a/engine/breeding.asm b/engine/breeding.asm
index 7756d30ef..c71387eee 100755
--- a/engine/breeding.asm
+++ b/engine/breeding.asm
@@ -112,14 +112,14 @@ CheckBreedmonCompatibility: ; 16e1d
ld [wCurSpecies], a
call GetBaseData
ld a, [wBaseEggGroups]
- cp NO_EGGS * $11
+ cp EGG_UNDISCOVERED * $11
jr z, .Incompatible
ld a, [wBreedMon1Species]
ld [wCurSpecies], a
call GetBaseData
ld a, [wBaseEggGroups]
- cp NO_EGGS * $11
+ cp EGG_UNDISCOVERED * $11
jr z, .Incompatible
; Ditto is automatically compatible with everything.
@@ -202,7 +202,7 @@ DoEggStep:: ; 16f3e
OverworldHatchEgg:: ; 16f5e
call RefreshScreen
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call HatchEggs
call ExitAllMenus
call RestartMapMusic
@@ -288,7 +288,7 @@ HatchEggs: ; 16f70 (5:6f70)
push hl
ld bc, MON_STAT_EXP - 1
add hl, bc
- ld b, $0
+ ld b, FALSE
predef CalcPkmnStats
pop bc
ld hl, MON_MAXHP
@@ -705,7 +705,7 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
call DisableLCD
ld hl, EggHatchGFX
ld de, vTiles0 tile $00
- ld bc, $20
+ ld bc, 2 tiles
ld a, BANK(EggHatchGFX)
call FarCopyBytes
farcall ClearSpriteAnims
@@ -887,26 +887,26 @@ Hatch_ShellFragmentLoop: ; 17418 (5:7418)
jr nz, .loop
ret
-Special_DayCareMon1: ; 17421
+DayCareMon1: ; 17421
ld hl, DayCareMon1Text
call PrintText
ld a, [wBreedMon1Species]
call PlayMonCry
ld a, [wDayCareLady]
- bit 0, a
+ bit DAYCARELADY_HAS_MON_F, a
jr z, DayCareMonCursor
call ButtonSound
ld hl, wBreedMon2Nick
call DayCareMonCompatibilityText
jp PrintText
-Special_DayCareMon2: ; 17440
+DayCareMon2: ; 17440
ld hl, DayCareMon2Text
call PrintText
ld a, [wBreedMon2Species]
call PlayMonCry
ld a, [wDayCareMan]
- bit 0, a
+ bit DAYCAREMAN_HAS_MON_F, a
jr z, DayCareMonCursor
call ButtonSound
ld hl, wBreedMon1Nick
diff --git a/engine/buy_sell_toss.asm b/engine/buy_sell_toss.asm
index d2cf14628..84481d030 100755
--- a/engine/buy_sell_toss.asm
+++ b/engine/buy_sell_toss.asm
@@ -1,6 +1,6 @@
SelectQuantityToToss: ; 24fbf
- ld hl, TossItem_MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, TossItem_MenuHeader
+ call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24fc9
@@ -12,8 +12,8 @@ RooftopSale_SelectQuantityToBuy: ; 24fcf
ld [wBuffer1], a
ld a, e
ld [wBuffer2], a
- ld hl, BuyItem_MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, BuyItem_MenuHeader
+ call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24fe1
@@ -24,8 +24,8 @@ SelectQuantityToSell: ; 24fe1
ld [wBuffer1], a
ld a, e
ld [wBuffer2], a
- ld hl, SellItem_MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, SellItem_MenuHeader
+ call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24ff9
@@ -138,9 +138,9 @@ BuySellToss_UpdateQuantityDisplay: ; 25072
ld de, wItemQuantityChangeBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
- ld a, [wMenuData2Pointer]
+ ld a, [wMenuDataPointer]
ld e, a
- ld a, [wMenuData2Pointer + 1]
+ ld a, [wMenuDataPointer + 1]
ld d, a
ld a, [wMenuDataBank]
call FarCall_de
@@ -213,21 +213,21 @@ BuySell_DisplaySubtotal: ; 250d1
ret
; 250ed
-TossItem_MenuDataHeader: ; 0x250ed
+TossItem_MenuHeader: ; 0x250ed
db MENU_BACKUP_TILES ; flags
menu_coords 15, 9, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
dw ret_25097
db 0 ; default option
; 0x250f5
-BuyItem_MenuDataHeader: ; 0x250f5
+BuyItem_MenuHeader: ; 0x250f5
db MENU_BACKUP_TILES ; flags
menu_coords 7, 15, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw DisplayPurchasePrice
db -1 ; default option
; 0x250fd
-SellItem_MenuDataHeader: ; 0x250fd
+SellItem_MenuHeader: ; 0x250fd
db MENU_BACKUP_TILES ; flags
menu_coords 7, 15, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw DisplaySellingPrice
diff --git a/engine/caught_data.asm b/engine/caught_data.asm
index 997d708c1..3bfacf539 100644
--- a/engine/caught_data.asm
+++ b/engine/caught_data.asm
@@ -1,4 +1,4 @@
-Special_CheckPartyFullAfterContest: ; 4d9e5
+CheckPartyFullAfterContest: ; 4d9e5
ld a, [wContestMon]
and a
jp z, .DidntCatchAnything
@@ -194,7 +194,7 @@ SetBoxmonOrEggmonCaughtData: ; 4db53
call GetWorldMapLocation
ld b, a
ld a, [wPlayerGender]
- rrca
+ rrca ; shift bit 0 (PLAYERGENDER_FEMALE_F) to bit 7 (CAUGHT_GENDER_MASK)
or b
ld [hl], a
ret
diff --git a/engine/cgb_layouts.asm b/engine/cgb_layouts.asm
index 1c2dfb7aa..b36dceeb6 100644
--- a/engine/cgb_layouts.asm
+++ b/engine/cgb_layouts.asm
@@ -184,7 +184,7 @@ InitPartyMenuBGPal0: ; 8e9f
_CGB_PokegearPals: ; 8eb9
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, FemalePokegearPals
jr .got_pals
@@ -821,7 +821,7 @@ _CGB_PackPals: ; 93d3
jr z, .tutorial_male
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .tutorial_male
ld hl, .KrisPackPals
diff --git a/engine/clock_reset.asm b/engine/clock_reset.asm
index 4c4a96b9c..58c24f732 100755
--- a/engine/clock_reset.asm
+++ b/engine/clock_reset.asm
@@ -38,7 +38,7 @@ RestartClock: ; 20021 (8:4021)
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearTileMap
ld hl, .Text_SetWithControlPad
call PrintText
diff --git a/engine/color.asm b/engine/color.asm
index 21842b7b3..1a38c3651 100644
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -337,11 +337,11 @@ ApplyHPBarPals:
ret
.Enemy:
- ld de, wBGPals2 palette PAL_BATTLE_BG_ENEMY_HP + 2
+ ld de, wBGPals2 palette PAL_BATTLE_BG_ENEMY_HP color 1
jr .okay
.Player:
- ld de, wBGPals2 palette PAL_BATTLE_BG_PLAYER_HP + 2
+ ld de, wBGPals2 palette PAL_BATTLE_BG_PLAYER_HP color 1
.okay
ld l, c
@@ -497,7 +497,7 @@ LoadHLPaletteIntoDE:
push af
ld a, BANK(wOBPals1)
ld [rSVBK], a
- ld c, $8
+ ld c, 1 palettes
.loop
ld a, [hli]
ld [de], a
@@ -521,7 +521,7 @@ LoadPalette_White_Col1_Col2_Black:
ld [de], a
inc de
- ld c, 2 * 2
+ ld c, 2 * PAL_COLOR_SIZE
.loop
ld a, [hli]
ld [de], a
@@ -707,7 +707,7 @@ GetPlayerOrMonPalettePointer:
and a
jp nz, GetMonNormalOrShinyPalettePointer
ld a, [wPlayerSpriteSetupFlags]
- bit 2, a ; transformed to male
+ bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .male
ld a, [wPlayerGender]
and a
@@ -1308,7 +1308,7 @@ rept 4
inc hl
endr
.morn_day
- ld de, wBGPals1 palette PAL_BG_ROOF + 2
+ ld de, wBGPals1 palette PAL_BG_ROOF color 1
ld bc, 4
ld a, BANK(wBGPals1)
call FarCopyWRAM
diff --git a/engine/crystal_intro.asm b/engine/crystal_intro.asm
index d6c467867..edc8d19d3 100755
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -1860,11 +1860,10 @@ Intro_LoadTilemap: ; e541b (39:541b)
inc de
dec c
jr nz, .col
- ; add hl, $20 - SCREEN_WIDTH
- ld a, $20 - SCREEN_WIDTH
+ ld a, BG_MAP_WIDTH - SCREEN_WIDTH
add l
ld l, a
- ld a, $0
+ ld a, 0
adc h
ld h, a
dec b
diff --git a/engine/debug.asm b/engine/debug.asm
index 52bd15f28..1904c240e 100755
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -1,4 +1,4 @@
-const_value set $6a
+ const_def $6a
const DEBUGTEST_UP_ARROW ; $6a
const DEBUGTEST_TICKS ; $6b
const DEBUGTEST_WHITE ; $6c
diff --git a/engine/decorations.asm b/engine/decorations.asm
index cf372159a..33d0ca0cd 100755
--- a/engine/decorations.asm
+++ b/engine/decorations.asm
@@ -5,11 +5,11 @@ InitDecorations: ; 26751 (9:6751)
ld [wDecoPoster], a
ret
-_KrisDecorationMenu: ; 0x2675c
+_PlayerDecorationMenu: ; 0x2675c
ld a, [wWhichIndexSet]
push af
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
xor a
ld [wBuffer5], a
ld a, $1
@@ -36,14 +36,14 @@ _KrisDecorationMenu: ; 0x2675c
ret
; 0x2679a
-.MenuDataHeader: ; 0x2679a
+.MenuHeader: ; 0x2679a
db MENU_BACKUP_TILES ; flags
menu_coords 5, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x267a2
-.MenuData2: ; 0x267a2
+.MenuData: ; 0x267a2
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items
dw wd002
@@ -374,8 +374,8 @@ PopulateDecoCategoryMenu: ; 2695b
jr nc, .beyond_eight
xor a
ld [wWhichIndexSet], a
- ld hl, .NonscrollingMenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .NonscrollingMenuHeader
+ call LoadMenuHeader
call DoNthMenu
jr c, .no_action_1
call DoDecorationAction2
@@ -391,9 +391,9 @@ PopulateDecoCategoryMenu: ; 2695b
ld d, 0
add hl, de
ld [hl], -1
- call LoadStandardMenuDataHeader
- ld hl, .ScrollingMenuDataHeader
- call CopyMenuDataHeader
+ call LoadStandardMenuHeader
+ ld hl, .ScrollingMenuHeader
+ call CopyMenuHeader
xor a
ld [hBGMapMode], a
call InitScrollingMenu
@@ -421,14 +421,14 @@ PopulateDecoCategoryMenu: ; 2695b
db "@"
; 0x269b5
-.NonscrollingMenuDataHeader: ; 0x269b5
+.NonscrollingMenuHeader: ; 0x269b5
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw .NonscrollingMenuData2
+ dw .NonscrollingMenuData
db 1 ; default option
; 0x269bd
-.NonscrollingMenuData2: ; 0x269bd
+.NonscrollingMenuData: ; 0x269bd
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items
dw wd002
@@ -436,14 +436,14 @@ PopulateDecoCategoryMenu: ; 2695b
dw DecorationAttributes
; 0x269c5
-.ScrollingMenuDataHeader: ; 0x269c5
+.ScrollingMenuHeader: ; 0x269c5
db MENU_BACKUP_TILES ; flags
menu_coords 1, 1, SCREEN_WIDTH - 2, SCREEN_HEIGHT - 2
- dw .ScrollingMenuData2
+ dw .ScrollingMenuData
db 1 ; default option
; 0x269cd
-.ScrollingMenuData2: ; 0x269cd
+.ScrollingMenuData: ; 0x269cd
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 8, 0 ; rows, columns
db 1 ; horizontal spacing
@@ -912,10 +912,10 @@ DecoText_WhichSide: ; 0x26e6b
DecoAction_AskWhichSide: ; 26e70
call MenuTextBox
- ld hl, MenuDataHeader_0x26eab
+ ld hl, MenuHeader_0x26eab
call GetMenu2
call ExitMenu
- call CopyMenuData2
+ call CopyMenuData
jr c, .nope
ld a, [wMenuCursorY]
cp 3
@@ -947,14 +947,14 @@ QueryWhichSide: ; 26e9a
ret
; 26eab
-MenuDataHeader_0x26eab: ; 0x26eab
+MenuHeader_0x26eab: ; 0x26eab
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 13, 7
- dw MenuData2_0x26eb3
+ dw MenuData_0x26eb3
db 1 ; default option
; 0x26eb3
-MenuData2_0x26eb3: ; 0x26eb3
+MenuData_0x26eb3: ; 0x26eb3
db STATICMENU_CURSOR ; flags
db 3 ; items
db "RIGHT SIDE@"
@@ -1102,7 +1102,7 @@ DecorationDesc_TownMapPoster: ; 0x26f91
opentext
writetext .TownMapText
waitbutton
- special Special_TownMap
+ special OverworldTownMap
closetext
end
; 0x26f9b
@@ -1194,7 +1194,7 @@ DecorationDesc_GiantOrnament: ; 26fdd
db "@"
; 0x26feb
-Special_ToggleMaptileDecorations: ; 26feb
+ToggleMaptileDecorations: ; 26feb
lb de, 0, 4
ld a, [wDecoBed]
call SetDecorationTile
@@ -1233,7 +1233,7 @@ SetPosterVisibility: ; 27027
ld b, RESET_FLAG
.ok
- ld de, EVENT_KRISS_ROOM_POSTER
+ ld de, EVENT_PLAYERS_ROOM_POSTER
jp EventFlagAction
; 27037
@@ -1248,20 +1248,20 @@ SetDecorationTile: ; 27037
ret
; 27043
-Special_ToggleDecorationsVisibility: ; 27043
- ld de, EVENT_KRISS_HOUSE_2F_CONSOLE
+ToggleDecorationsVisibility: ; 27043
+ ld de, EVENT_PLAYERS_HOUSE_2F_CONSOLE
ld hl, wVariableSprites + SPRITE_CONSOLE - SPRITE_VARS
ld a, [wDecoConsole]
call ToggleDecorationVisibility
- ld de, EVENT_KRISS_HOUSE_2F_DOLL_1
+ ld de, EVENT_PLAYERS_HOUSE_2F_DOLL_1
ld hl, wVariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
ld a, [wDecoLeftOrnament]
call ToggleDecorationVisibility
- ld de, EVENT_KRISS_HOUSE_2F_DOLL_2
+ ld de, EVENT_PLAYERS_HOUSE_2F_DOLL_2
ld hl, wVariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
ld a, [wDecoRightOrnament]
call ToggleDecorationVisibility
- ld de, EVENT_KRISS_HOUSE_2F_BIG_DOLL
+ ld de, EVENT_PLAYERS_HOUSE_2F_BIG_DOLL
ld hl, wVariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
ld a, [wDecoBigDoll]
call ToggleDecorationVisibility
diff --git a/engine/delete_save_change_clock.asm b/engine/delete_save_change_clock.asm
index fd6ffae2c..431dc6034 100755
--- a/engine/delete_save_change_clock.asm
+++ b/engine/delete_save_change_clock.asm
@@ -8,8 +8,8 @@ _ResetClock: ; 4d3b1
call PlayMusic
ld hl, .text_askreset
call PrintText
- ld hl, .NoYes_MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .NoYes_MenuHeader
+ call CopyMenuHeader
call VerticalMenu
ret c
ld a, [wMenuCursorY]
@@ -46,13 +46,13 @@ _ResetClock: ; 4d3b1
text_jump UnknownText_0x1c561c
db "@"
-.NoYes_MenuDataHeader: ; 0x4d40d
+.NoYes_MenuHeader: ; 0x4d40d
db 0 ; flags
menu_coords 14, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .NoYes_MenuData2
+ dw .NoYes_MenuData
db 1 ; default option
-.NoYes_MenuData2: ; 0x4d415
+.NoYes_MenuData: ; 0x4d415
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 2 ; items
db "NO@"
@@ -268,8 +268,8 @@ _DeleteSaveData: ; 4d54c
call PlayMusic
ld hl, .Text_ClearAllSaveData
call PrintText
- ld hl, .NoYesMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .NoYesMenuHeader
+ call CopyMenuHeader
call VerticalMenu
ret c
ld a, [wMenuCursorY]
@@ -283,13 +283,13 @@ _DeleteSaveData: ; 4d54c
text_jump UnknownText_0x1c564a
db "@"
-.NoYesMenuDataHeader: ; 0x4d585
+.NoYesMenuHeader: ; 0x4d585
db 0 ; flags
menu_coords 14, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
-.MenuData2: ; 0x4d58d
+.MenuData: ; 0x4d58d
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 2 ; items
db "NO@"
diff --git a/engine/events.asm b/engine/events.asm
index 2b4cfd586..35a54138b 100644
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -493,7 +493,7 @@ CheckTimeEvents: ; 9693a
jr nz, .nothing
ld hl, wStatusFlags2
- bit 2, [hl] ; bug contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr z, .do_daily
farcall CheckBugContestTimer
@@ -914,8 +914,8 @@ SelectMenuScript: ; 96b5f
StartMenuCallback:
SelectMenuCallback: ; 96b66
copybytetovar hMenuReturn
- if_equal HMENURETURN_SCRIPT, .Script
- if_equal HMENURETURN_ASM, .Asm
+ ifequal HMENURETURN_SCRIPT, .Script
+ ifequal HMENURETURN_ASM, .Asm
end
; 96b72
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 4b4494925..b586096bb 100755
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -1,11 +1,11 @@
-Special_BattleTowerRoomMenu: ; 1700b0
+BattleTowerRoomMenu: ; 1700b0
; special
call InitBattleTowerChallengeRAM
farcall _BattleTowerRoomMenu
ret
; 1700ba
-Special_Function1700ba: ; 1700ba
+Function1700ba: ; 1700ba
call InitBattleTowerChallengeRAM
farcall Function11811a
ret
@@ -53,7 +53,7 @@ Function1700c4: ; 1700c4
ret
; 170114
-Special_Function170114: ; 170114
+Function170114: ; 170114
call InitBattleTowerChallengeRAM
call .Function170121
farcall Function11805f
@@ -182,7 +182,7 @@ Function170139: ; 170139
ret
; 170215
-Special_BattleTowerBattle: ; 170215
+BattleTowerBattle: ; 170215
xor a
ld [wBattleTowerBattleEnded], a
call _BattleTowerBattle
@@ -243,7 +243,7 @@ RunBattleTowerTrainer: ; 17024d
xor a
ld [wLinkMode], a
- farcall Special_StubbedTrainerRankings_Healings
+ farcall StubbedTrainerRankings_Healings
farcall HealParty
call ReadBTTrainerParty
call Clears5_a89a
@@ -407,11 +407,11 @@ ValidateBTParty: ; 170394
ld c, l
ld a, [hl]
and a
-idx = $ff
-rept ($ff +- NUM_POKEMON)
+x = $ff
+rept ($ff + -NUM_POKEMON)
jr z, .invalid
- cp idx
-idx = idx +- 1
+ cp x
+x = x + -1
endr
jr nz, .valid
@@ -619,7 +619,7 @@ Unreferenced_Function1704ca: ; 1704ca
ret
; 1704e1
-UnusedSpecial_Function1704e1: ; 1704e1
+Function1704e1: ; 1704e1
call SpeechTextBox
call FadeToMenu
call InitBattleTowerChallengeRAM
@@ -900,7 +900,7 @@ UnusedSpecial_Function1704e1: ; 1704e1
db "れきだいりーダーいちらん@"
; 170687
-Special_BattleTowerAction: ; 170687
+BattleTowerAction: ; 170687
ld a, [wScriptVar]
ld e, a
ld d, 0
@@ -1603,7 +1603,7 @@ BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19
ld [wScriptVar], a
ret
-Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
+LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
farcall Function_LoadOpponentTrainerAndPokemons
ld a, [rSVBK]
push af
@@ -1654,8 +1654,8 @@ DummySpecial_170bd2: ; 170bd2
ret
; 170bd3
-Special_CheckForBattleTowerRules: ; 170bd3
- farcall CheckForBattleTowerRules
+CheckForBattleTowerRules: ; 170bd3
+ farcall _CheckForBattleTowerRules
jr c, .asm_170bde
xor a ; FALSE
jr .asm_170be0
diff --git a/engine/events/battle_tower/get_trainer_class.asm b/engine/events/battle_tower/get_trainer_class.asm
index 37fe91c56..570104a2a 100644
--- a/engine/events/battle_tower/get_trainer_class.asm
+++ b/engine/events/battle_tower/get_trainer_class.asm
@@ -15,7 +15,7 @@ GetMobileOTTrainerClass: ; mobile function
.male_trainer_loop
srl c
ld a, c
- cp MaleTrainersEnd - MaleTrainers - 1
+ cp MaleTrainers.End - MaleTrainers - 1
jr nc, .male_trainer_loop
inc c
@@ -33,7 +33,7 @@ GetMobileOTTrainerClass: ; mobile function
.female_trainer_loop
srl c
ld a, c
- cp FemaleTrainersEnd - FemaleTrainers - 1
+ cp FemaleTrainers.End - FemaleTrainers - 1
jr nc, .female_trainer_loop
inc c
diff --git a/engine/events/battle_tower/rules.asm b/engine/events/battle_tower/rules.asm
index fc9fa948a..995cd1edc 100644
--- a/engine/events/battle_tower/rules.asm
+++ b/engine/events/battle_tower/rules.asm
@@ -29,7 +29,7 @@ CheckForMobileBattleRules: ; 8b1e1
db "@"
; 0x8b201
-CheckForBattleTowerRules: ; 8b201
+_CheckForBattleTowerRules: ; 8b201
ld hl, wStringBuffer2
ld [hl], "3"
inc hl
diff --git a/engine/events/buena.asm b/engine/events/buena.asm
index 1991d6a86..533ce43ef 100644
--- a/engine/events/buena.asm
+++ b/engine/events/buena.asm
@@ -1,8 +1,8 @@
-Special_BuenasPassword: ; 8af6b
+BuenasPassword: ; 8af6b
xor a
ld [wWhichIndexSet], a
- ld hl, .MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .MenuHeader
+ call CopyMenuHeader
ld a, [wBuenasPassword]
ld c, a
farcall GetBuenasPassword
@@ -28,16 +28,16 @@ Special_BuenasPassword: ; 8af6b
ret
; 8afa9
-.MenuDataHeader: ; 0x8afa9
+.MenuHeader: ; 0x8afa9
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 10, 7
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x8afb1
db 0
-.MenuData2: ; 0x8afb2
+.MenuData: ; 0x8afb2
db STATICMENU_CURSOR | STATICMENU_DISABLE_B ; flags
db 0 ; items
dw .PasswordIndices
@@ -67,7 +67,7 @@ endr
ret
; 8afd4
-Special_BuenaPrize: ; 8afd4
+BuenaPrize: ; 8afd4
xor a
ld [wMenuScrollPosition], a
ld a, $1
@@ -187,8 +187,8 @@ Special_BuenaPrize: ; 8afd4
; 0x8b090
Buena_DisplayBlueCardBalance: ; 8b090
- ld hl, BlueCardBalanceMenuDataHeader
- call LoadMenuDataHeader
+ ld hl, BlueCardBalanceMenuHeader
+ call LoadMenuHeader
ret
; 8b097
@@ -202,8 +202,8 @@ PrintBlueCardBalance: ; 8b097
push de
xor a
ld [hBGMapMode], a
- ld hl, BlueCardBalanceMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, BlueCardBalanceMenuHeader
+ call CopyMenuHeader
call MenuBox
call UpdateSprites
call MenuBoxCoord2Tile
@@ -227,25 +227,25 @@ PrintBlueCardBalance: ; 8b097
db "Points@"
; 8b0d1
-BlueCardBalanceMenuDataHeader: ; 0x8b0d1
+BlueCardBalanceMenuHeader: ; 0x8b0d1
db MENU_BACKUP_TILES ; flags
menu_coords 0, 11, 11, 13
; 8b0d6
Buena_PlacePrizeMenuBox: ; 8b0d6
- ld hl, .menudataheader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
ret
; 8b0dd
-.menudataheader ; 0x8b0dd
+.MenuHeader ; 0x8b0dd
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 17, TEXTBOX_Y - 1
; 8b0e2
Buena_PrizeMenu: ; 8b0e2
- ld hl, .MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .MenuHeader
+ call CopyMenuHeader
ld a, [wMenuSelection]
ld [wMenuCursorBuffer], a
xor a
@@ -270,16 +270,16 @@ Buena_PrizeMenu: ; 8b0e2
ret
; 8b113
-.MenuDataHeader: ; 0x8b113
+.MenuHeader: ; 0x8b113
db MENU_BACKUP_TILES ; flags
menu_coords 1, 1, 16, 9
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x8b11b
db 0
-.MenuData2: ; 0x8b11c
+.MenuData: ; 0x8b11c
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 13 ; rows, columns
db 1 ; spacing
@@ -288,7 +288,7 @@ Buena_PrizeMenu: ; 8b0e2
dba .prizepoints
; 8b129
-NUM_BUENA_PRIZES EQU 9 ; ((BuenaPrizeItemsEnd - BuenaPrizeItems) / 2)
+NUM_BUENA_PRIZES EQU 9 ; ((BuenaPrizeItems.End - BuenaPrizeItems) / 2)
.indices ; 8b129
db NUM_BUENA_PRIZES
diff --git a/engine/events/buena_menu.asm b/engine/events/buena_menu.asm
index 047d1e7e3..d55a6c9fa 100644
--- a/engine/events/buena_menu.asm
+++ b/engine/events/buena_menu.asm
@@ -1,4 +1,4 @@
-Special_AskRememberPassword: ; 4ae12
+AskRememberPassword: ; 4ae12
call .DoMenu
ld a, $0
jr c, .okay
@@ -11,8 +11,8 @@ Special_AskRememberPassword: ; 4ae12
.DoMenu: ; 4ae1f
lb bc, 14, 7
push bc
- ld hl, YesNoMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, YesNoMenuHeader
+ call CopyMenuHeader
pop bc
ld a, b
ld [wMenuBorderLeftCoord], a
diff --git a/engine/events/bug_contest/contest.asm b/engine/events/bug_contest/contest.asm
index ba561abf2..c25da1658 100644
--- a/engine/events/bug_contest/contest.asm
+++ b/engine/events/bug_contest/contest.asm
@@ -1,4 +1,4 @@
-Special_GiveParkBalls: ; 135db
+GiveParkBalls: ; 135db
xor a
ld [wContestMon], a
ld a, 20
diff --git a/engine/events/bug_contest/contest_2.asm b/engine/events/bug_contest/contest_2.asm
index 8913dee6f..3e3b16b21 100755
--- a/engine/events/bug_contest/contest_2.asm
+++ b/engine/events/bug_contest/contest_2.asm
@@ -1,4 +1,4 @@
-Special_SelectRandomBugContestContestants: ; 139a8
+SelectRandomBugContestContestants: ; 139a8
; Select five random people to participate in the current contest.
; First we have to make sure that any old data is cleared away.
@@ -56,10 +56,11 @@ Special_SelectRandomBugContestContestants: ; 139a8
ret
; 139ed
-Special_CheckBugContestContestantFlag: ; 139ed
+CheckBugContestContestantFlag: ; 139ed
; Checks the flag of the Bug Catching Contestant whose index is loaded in a.
-; Bug: If a >= NUM_BUG_CONTESTANTS when this is called, it will read beyond the table.
+; Bug: If a >= NUM_BUG_CONTESTANTS when this is called,
+; it will read beyond the table.
ld hl, BugCatchingContestantEventFlagTable
ld e, a
@@ -74,9 +75,9 @@ Special_CheckBugContestContestantFlag: ; 139ed
ret
; 139fe
-INCLUDE "data/bug_contest_flags.asm"
+INCLUDE "data/events/bug_contest_flags.asm"
-Special_ContestDropOffMons: ; 13a12
+ContestDropOffMons: ; 13a12
ld hl, wPartyMon1HP
ld a, [hli]
or [hl]
@@ -101,7 +102,7 @@ Special_ContestDropOffMons: ; 13a12
ret
; 13a31
-Special_ContestReturnMons: ; 13a31
+ContestReturnMons: ; 13a31
; Restore the species of the second mon.
ld hl, wPartySpecies + 1
ld a, [wBugContestSecondPartySpecies]
diff --git a/engine/events/bug_contest/judging.asm b/engine/events/bug_contest/judging.asm
index c63087397..a338e83ec 100755
--- a/engine/events/bug_contest/judging.asm
+++ b/engine/events/bug_contest/judging.asm
@@ -134,7 +134,7 @@ LoadContestantName: ; 13730
; 13783
-INCLUDE "data/bug_contest_winners.asm"
+INCLUDE "data/events/bug_contest_winners.asm"
; 13807
@@ -229,7 +229,7 @@ DetermineContestWinners: ; 1383e
CopyTempContestant: ; 138a0
; Could've just called CopyBytes.
ld de, wBugContestTempWinnerID
-rept BUG_CONTESTANT_SIZE +- 1
+rept BUG_CONTESTANT_SIZE + -1
ld a, [de]
inc de
ld [hli], a
@@ -244,7 +244,7 @@ ComputeAIContestantScores: ; 138b0
ld e, 0
.loop
push de
- call Special_CheckBugContestContestantFlag
+ call CheckBugContestContestantFlag
pop de
jr nz, .done
ld a, e
diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm
index fe4a490f2..87876f1cb 100755
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -1,6 +1,6 @@
SPECIALCELEBIEVENT_CELEBI EQU $84
-Special_CelebiShrineEvent: ; 4989a
+CelebiShrineEvent: ; 4989a
call DelayFrame
ld a, [wVramState]
push af
@@ -57,7 +57,7 @@ Special_CelebiShrineEvent: ; 4989a
ld c, 4
.OAMloop:
ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
inc a
@@ -281,7 +281,7 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b)
; 49b6e (12:5b6e)
.sinewave ; 49b6e
- sine_wave $100
+ sine_wave 32
; 49bae
GetCelebiSpriteTile: ; 49bae
@@ -362,7 +362,7 @@ CelebiEvent_SetBattleType: ; 49bf3
; 49bf9
-Special_CheckCaughtCelebi: ; 49bf9
+CheckCaughtCelebi: ; 49bf9
ld a, [wBattleResult]
bit 6, a
jr z, .false
diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm
index 3d36bbfd7..7da559e75 100755
--- a/engine/events/daycare.asm
+++ b/engine/events/daycare.asm
@@ -21,9 +21,9 @@
const DAYCARETEXT_OH_FINE
const DAYCARETEXT_COME_AGAIN
-Special_DayCareMan: ; 166d6
+DayCareMan: ; 166d6
ld hl, wDayCareMan
- bit 0, [hl]
+ bit DAYCAREMAN_HAS_MON_F, [hl]
jr nz, .AskWithdrawMon
ld hl, wDayCareMan
ld a, DAYCARETEXT_MAN_INTRO
@@ -33,7 +33,7 @@ Special_DayCareMan: ; 166d6
jr c, .print_text
farcall DepositMonWithDayCareMan
ld hl, wDayCareMan
- set 0, [hl]
+ set DAYCAREMAN_HAS_MON_F, [hl]
call DayCare_DepositPokemonText
call DayCare_InitBreeding
ret
@@ -47,8 +47,8 @@ Special_DayCareMan: ; 166d6
farcall RetrievePokemonFromDayCareMan
call DayCare_GetBackMonForMoney
ld hl, wDayCareMan
- res 0, [hl]
- res 5, [hl]
+ res DAYCAREMAN_HAS_MON_F, [hl]
+ res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
jr .cancel
.print_text
@@ -60,9 +60,9 @@ Special_DayCareMan: ; 166d6
ret
; 1672a
-Special_DayCareLady: ; 1672a
+DayCareLady: ; 1672a
ld hl, wDayCareLady
- bit 0, [hl]
+ bit DAYCARELADY_HAS_MON_F, [hl]
jr nz, .AskWithdrawMon
ld hl, wDayCareLady
ld a, DAYCARETEXT_LADY_INTRO
@@ -72,7 +72,7 @@ Special_DayCareLady: ; 1672a
jr c, .print_text
farcall DepositMonWithDayCareLady
ld hl, wDayCareLady
- set 0, [hl]
+ set DAYCARELADY_HAS_MON_F, [hl]
call DayCare_DepositPokemonText
call DayCare_InitBreeding
ret
@@ -86,9 +86,9 @@ Special_DayCareLady: ; 1672a
farcall RetrievePokemonFromDayCareLady
call DayCare_GetBackMonForMoney
ld hl, wDayCareLady
- res 0, [hl]
+ res DAYCARELADY_HAS_MON_F, [hl]
ld hl, wDayCareMan
- res 5, [hl]
+ res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
jr .cancel
.print_text
@@ -101,9 +101,9 @@ Special_DayCareLady: ; 1672a
; 16781
DayCareLadyIntroText: ; 16781
- bit 7, [hl]
+ bit DAYCARELADY_ACTIVE_F, [hl]
jr nz, .okay
- set 7, [hl]
+ set DAYCARELADY_ACTIVE_F, [hl]
inc a
.okay
call PrintDayCareText
@@ -112,7 +112,7 @@ DayCareLadyIntroText: ; 16781
; 1678f
DayCareManIntroText: ; 1678f
- set 7, [hl]
+ set DAYCAREMAN_ACTIVE_F, [hl]
call PrintDayCareText
call YesNoBox
ret
@@ -427,9 +427,9 @@ PrintDayCareText: ; 1689b
db "@"
; 0x16936
-Special_DayCareManOutside: ; 16936
+DayCareManOutside: ; 16936
ld hl, wDayCareMan
- bit 6, [hl]
+ bit DAYCAREMAN_HAS_EGG_F, [hl]
jr nz, .AskGiveEgg
ld hl, .NotYet
call PrintText
@@ -451,7 +451,7 @@ Special_DayCareManOutside: ; 16936
jr nc, .PartyFull
call DayCare_GiveEgg
ld hl, wDayCareMan
- res 6, [hl]
+ res DAYCAREMAN_HAS_EGG_F, [hl]
call DayCare_InitBreeding
ld hl, .GotEggText
call PrintText
@@ -593,10 +593,10 @@ DayCare_GetCurrentPartyMember: ; 16a31
DayCare_InitBreeding: ; 16a3b
ld a, [wDayCareLady]
- bit 0, a
+ bit DAYCARELADY_HAS_MON_F, a
ret z
ld a, [wDayCareMan]
- bit 0, a
+ bit DAYCAREMAN_HAS_MON_F, a
ret z
callfar CheckBreedmonCompatibility
ld a, [wd265]
@@ -605,7 +605,7 @@ DayCare_InitBreeding: ; 16a3b
inc a
ret z
ld hl, wDayCareMan
- set 5, [hl]
+ set DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
.loop
call Random
cp 150
@@ -660,6 +660,7 @@ DayCare_InitBreeding: ; 16a3b
ld a, EGG_LEVEL
ld [wCurPartyLevel], a
+; Nidoran♀ can give birth to either gender of Nidoran
ld a, [wCurPartySpecies]
cp NIDORAN_F
jr nz, .GotEggSpecies
diff --git a/engine/events/dratini.asm b/engine/events/dratini.asm
index a45f01195..1019e302e 100644
--- a/engine/events/dratini.asm
+++ b/engine/events/dratini.asm
@@ -1,4 +1,4 @@
-Special_Dratini: ; 0x8b170
+GiveDratini: ; 0x8b170
; if wScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
; 0: give it a special moveset with Extremespeed.
; 1: give it the normal moveset of a level 15 Dratini.
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 98d408b0e..bcad170d4 100755
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -119,12 +119,12 @@ Elevator_GoToFloor: ; 134c0
; 134dd
Elevator_AskWhichFloor: ; 134dd
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Elevator_WhichFloorText
call PrintText
call Elevator_GetCurrentFloorText
- ld hl, Elevator_MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, Elevator_MenuHeader
+ call CopyMenuHeader
call InitScrollingMenu
call UpdateSprites
xor a
@@ -187,14 +187,14 @@ Elevator_GetCurrentFloorString: ; 1353f
ret
; 13550
-Elevator_MenuDataHeader: ; 0x13550
+Elevator_MenuHeader: ; 0x13550
db MENU_BACKUP_TILES ; flags
menu_coords 12, 1, 18, 9
- dw Elevator_MenuData2
+ dw Elevator_MenuData
db 1 ; default option
; 0x13558
-Elevator_MenuData2: ; 0x13558
+Elevator_MenuData: ; 0x13558
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows, columns
db 1 ; horizontal spacing
@@ -229,4 +229,4 @@ FloorToString: ; 13575
ret
; 13583
-INCLUDE "data/elevator_floors.asm"
+INCLUDE "data/events/elevator_floors.asm"
diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm
index 0f12338e0..2fc30d25c 100755
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -7,15 +7,15 @@ PlayWhirlpoolSound: ; 8c7d4
; 8c7e1
BlindingFlash: ; 8c7e1
- farcall Special_FadeOutPalettes
+ farcall FadeOutPalettes
ld hl, wStatusFlags
- set 2, [hl] ; Flash
+ set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
ld b, SCGB_MAPPALS
call GetSGBLayout
farcall LoadOW_BGPal7
- farcall Special_FadeInPalettes
+ farcall FadeInPalettes
ret
; 8c80a
@@ -398,7 +398,7 @@ FlyToAnim: ; 8cb33
ld c, 4
.OAMloop
ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
inc a
diff --git a/engine/events/fish.asm b/engine/events/fish.asm
index d79ac0a43..09de8f2b7 100644
--- a/engine/events/fish.asm
+++ b/engine/events/fish.asm
@@ -98,7 +98,7 @@ GetFishGroupIndex: ; 9245b
push hl
ld hl, wDailyFlags
- bit 2, [hl]
+ bit DAILYFLAGS_FISH_SWARM_F, [hl]
pop hl
jr z, .done
diff --git a/engine/events/forced_movement.asm b/engine/events/forced_movement.asm
index 136698501..2d03659ff 100755
--- a/engine/events/forced_movement.asm
+++ b/engine/events/forced_movement.asm
@@ -1,9 +1,9 @@
Script_ForcedMovement:: ; 0x1253d
checkcode VAR_FACING
- if_equal DOWN, .down
- if_equal UP, .up
- if_equal LEFT, .left
- if_equal RIGHT, .right
+ ifequal DOWN, .down
+ ifequal UP, .up
+ ifequal LEFT, .left
+ ifequal RIGHT, .right
end
; 0x12550
diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm
index 796880175..47d7702b4 100644
--- a/engine/events/fruit_trees.asm
+++ b/engine/events/fruit_trees.asm
@@ -44,7 +44,7 @@ GetCurTreeFruit: ; 44041
TryResetFruitTrees: ; 4404c
ld hl, wDailyFlags
- bit 4, [hl]
+ bit DAILYFLAGS_ALL_FRUIT_TREES_F, [hl]
ret nz
jp ResetFruitTrees
; 44055
@@ -71,7 +71,7 @@ ResetFruitTrees: ; 4406a
ld [hli], a
ld [hl], a
ld hl, wDailyFlags
- set 4, [hl]
+ set DAILYFLAGS_ALL_FRUIT_TREES_F, [hl]
ret
; 44078
diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm
index 78b5cbe03..8b6f2a62e 100755
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -12,7 +12,7 @@ HallOfFame:: ; 0x8640e
; Enable the Pokégear map to cycle through all of Kanto
ld hl, wStatusFlags
- set 6, [hl] ; hall of fame
+ set STATUSFLAGS_HALL_OF_FAME_F, [hl]
farcall HallOfFame_InitSaveIfNeeded
@@ -42,7 +42,7 @@ RedCredits:: ; 86455
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
- farcall Special_FadeOutPalettes
+ farcall FadeOutPalettes
xor a
ld [wVramState], a
ld [hMapAnims], a
@@ -65,7 +65,7 @@ HallOfFame_FadeOutMusic: ; 8648e
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
- farcall Special_FadeOutPalettes
+ farcall FadeOutPalettes
xor a
ld [wVramState], a
ld [hMapAnims], a
diff --git a/engine/events/happiness_egg.asm b/engine/events/happiness_egg.asm
index 0c516247f..998e7e07a 100755
--- a/engine/events/happiness_egg.asm
+++ b/engine/events/happiness_egg.asm
@@ -1,4 +1,4 @@
-Special_GetFirstPokemonHappiness: ; 718d
+GetFirstPokemonHappiness: ; 718d
ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
ld de, wPartySpecies
@@ -17,7 +17,7 @@ Special_GetFirstPokemonHappiness: ; 718d
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
-Special_CheckFirstMonIsEgg: ; 71ac
+CheckFirstMonIsEgg: ; 71ac
ld a, [wPartySpecies]
ld [wd265], a
cp EGG
@@ -103,7 +103,7 @@ ChangeHappiness: ; 71c2
ret
-INCLUDE "data/happiness_changes.asm"
+INCLUDE "data/events/happiness_changes.asm"
StepHappiness:: ; 725a
@@ -146,7 +146,7 @@ DayCareStep:: ; 7282
; Raise the experience of Day-Care Pokémon every step cycle.
ld a, [wDayCareMan]
- bit 0, a
+ bit DAYCAREMAN_HAS_MON_F, a
jr z, .day_care_lady
ld a, [wBreedMon1Level] ; level
@@ -168,7 +168,7 @@ DayCareStep:: ; 7282
.day_care_lady
ld a, [wDayCareLady]
- bit 0, a
+ bit DAYCARELADY_HAS_MON_F, a
jr z, .check_egg
ld a, [wBreedMon2Level] ; level
@@ -190,7 +190,7 @@ DayCareStep:: ; 7282
.check_egg
ld hl, wDayCareMan
- bit 5, [hl] ; egg
+ bit DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
ret z
ld hl, wStepsToEgg
dec [hl]
@@ -218,6 +218,6 @@ DayCareStep:: ; 7282
cp b
ret nc
ld hl, wDayCareMan
- res 5, [hl]
- set 6, [hl]
+ res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
+ set DAYCAREMAN_HAS_EGG_F, [hl]
ret
diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm
index 400645b47..955449280 100755
--- a/engine/events/heal_machine_anim.asm
+++ b/engine/events/heal_machine_anim.asm
@@ -1,4 +1,4 @@
-; Special_HealMachineAnim.Jumptable indexes
+; HealMachineAnim.Jumptable indexes
const_def
const HEALMACHINESTATE_LOADGFX
const HEALMACHINESTATE_PCLOADBALLS
@@ -7,7 +7,7 @@
const HEALMACHINESTATE_HOFPLAYSFX
const HEALMACHINESTATE_FINISH
-Special_HealMachineAnim: ; 12324
+HealMachineAnim: ; 12324
; If you have no Pokemon, don't change the buffer. This can lead to some glitchy effects if you have no Pokemon.
ld a, [wPartyCount]
and a
diff --git a/engine/events/kurt.asm b/engine/events/kurt.asm
index 79eb7da2e..8fe78f5b6 100644
--- a/engine/events/kurt.asm
+++ b/engine/events/kurt.asm
@@ -22,8 +22,8 @@ Kurt_PrintTextHowMany: ; 8800c
db "@"
; 0x88018
-Special_SelectApricornForKurt: ; 88018
- call LoadStandardMenuDataHeader
+SelectApricornForKurt: ; 88018
+ call LoadStandardMenuHeader
ld c, $1
xor a
ld [wMenuScrollPosition], a
@@ -59,8 +59,8 @@ Special_SelectApricornForKurt: ; 88018
Kurt_SelectApricorn: ; 88055
farcall FindApricornsInBag
jr c, .nope
- ld hl, .MenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .MenuHeader
+ call CopyMenuHeader
ld a, [wMenuSelection]
ld [wMenuCursorBuffer], a
xor a
@@ -83,16 +83,16 @@ Kurt_SelectApricorn: ; 88055
ret
; 88086
-.MenuDataHeader: ; 0x88086
+.MenuHeader: ; 0x88086
db MENU_BACKUP_TILES ; flags
menu_coords 1, 1, 13, 10
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x8808e
db 0 ; XXX
-.MenuData2: ; 0x8808f
+.MenuData: ; 0x8808f
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 7
db 1
@@ -129,8 +129,8 @@ Kurt_SelectQuantity: ; 880c2
ld [wItemQuantityBuffer], a
ld a, $1
ld [wItemQuantityChangeBuffer], a
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
.loop
xor a
ld [hBGMapMode], a
@@ -157,7 +157,7 @@ Kurt_SelectQuantity: ; 880c2
ret
; 8810d
-.MenuDataHeader: ; 0x8810d
+.MenuHeader: ; 0x8810d
db MENU_BACKUP_TILES ; flags
menu_coords 6, 9, SCREEN_WIDTH - 1, 12
dw NULL
diff --git a/engine/events/loadfishinggfx.asm b/engine/events/loadfishinggfx.asm
index f67c51d8b..3d3ab0ba0 100644
--- a/engine/events/loadfishinggfx.asm
+++ b/engine/events/loadfishinggfx.asm
@@ -6,7 +6,7 @@ LoadFishingGFX: ; b84b3
ld de, FishingGFX
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld de, KrisFishingGFX
.got_gender
diff --git a/engine/events/lucky_number.asm b/engine/events/lucky_number.asm
index 1582cec7d..f482ce9d6 100644
--- a/engine/events/lucky_number.asm
+++ b/engine/events/lucky_number.asm
@@ -1,4 +1,4 @@
-Special_CheckForLuckyNumberWinners: ; 4d87a
+CheckForLuckyNumberWinners: ; 4d87a
xor a
ld [wScriptVar], a
ld [wFoundMatchingIDInParty], a
@@ -216,7 +216,7 @@ Special_CheckForLuckyNumberWinners: ; 4d87a
text_jump UnknownText_0x1c12ae
db "@"
-Special_PrintTodaysLuckyNumber: ; 4d9d3
+PrintTodaysLuckyNumber: ; 4d9d3
ld hl, wStringBuffer3
ld de, wLuckyIDNumber
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
diff --git a/engine/events/magikarp.asm b/engine/events/magikarp.asm
index 8d835960f..f5180a8e5 100644
--- a/engine/events/magikarp.asm
+++ b/engine/events/magikarp.asm
@@ -1,4 +1,4 @@
-Special_CheckMagikarpLength: ; fbb32
+CheckMagikarpLength: ; fbb32
; Returns 3 if you select a Magikarp that beats the previous record.
; Returns 2 if you select a Magikarp, but the current record is longer.
; Returns 1 if you press B in the Pokemon selection menu.
@@ -189,7 +189,7 @@ CalcMagikarpLength: ; fbbfc
.no
- ld hl, .Lengths
+ ld hl, MagikarpLengths
ld a, 2
ld [wd265], a
@@ -308,30 +308,11 @@ CalcMagikarpLength: ; fbbfc
ret
; fbca8
-.Lengths: ; fbca8
-; [wMagikarpLength] = z * 100 + (bc - x) / y
-; First argument is the bc threshold as well as x.
-; Second argument is y.
-; In reality, due to the bug at .BCLessThanDE, the threshold is determined by only register b.
- dwb 110, 1 ; not used unless the bug is fixed
- dwb 310, 2
- dwb 710, 4
- dwb 2710, 20
- dwb 7710, 50
- dwb 17710, 100
- dwb 32710, 150
- dwb 47710, 150
- dwb 57710, 100
- dwb 62710, 50
- dwb 64710, 20
- dwb 65210, 5
- dwb 65410, 2
- dwb 65510, 1 ; not used
-; fbcd2
-
-
-
-Special_MagikarpHouseSign: ; fbcd2
+INCLUDE "data/events/magikarp_lengths.asm"
+
+
+
+MagikarpHouseSign: ; fbcd2
ld a, [wBestMagikarpLengthFeet]
ld [wMagikarpLength], a
ld a, [wBestMagikarpLengthInches]
diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm
index ed7caf218..6f2aa2d1f 100755
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -1,4 +1,4 @@
-Special_MagnetTrain: ; 8cc04
+MagnetTrain: ; 8cc04
ld a, [wScriptVar]
and a
jr nz, .ToGoldenrod
@@ -327,7 +327,7 @@ MagnetTrain_Jumptable: ; 8cdf7
ld a, BANK(wPlayerGender)
ld [rSVBK], a
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE
diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm
index 4e4d5dc86..b79889f72 100755
--- a/engine/events/misc_scripts.asm
+++ b/engine/events/misc_scripts.asm
@@ -2,7 +2,7 @@ Script_AbortBugContest: ; 0x122c1
checkflag ENGINE_BUG_CONTEST_TIMER
iffalse .finish
setflag ENGINE_DAILY_BUG_CONTEST
- special Special_ContestReturnMons
+ special ContestReturnMons
.finish
end
diff --git a/engine/events/mom.asm b/engine/events/mom.asm
index fbda552ad..1a00b723a 100644
--- a/engine/events/mom.asm
+++ b/engine/events/mom.asm
@@ -1,4 +1,4 @@
-Special_BankOfMom: ; 16218
+BankOfMom: ; 16218
ld a, [hInMenu]
push af
ld a, $1
@@ -46,9 +46,9 @@ Special_BankOfMom: ; 16218
.CheckIfBankInitialized: ; 16254
ld a, [wMomSavingMoney]
- bit 7, a
+ bit MOM_ACTIVE_F, a
jr nz, .savingmoneyalready
- set 7, a
+ set MOM_ACTIVE_F, a
ld [wMomSavingMoney], a
ld a, $1
jr .done_0
@@ -68,11 +68,11 @@ Special_BankOfMom: ; 16218
jr c, .DontSaveMoney
ld hl, UnknownText_0x1664e
call PrintText
- ld a, %10000001
+ ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
jr .done_1
.DontSaveMoney:
- ld a, %10000000
+ ld a, 1 << MOM_ACTIVE_F
.done_1
ld [wMomSavingMoney], a
@@ -103,9 +103,9 @@ Special_BankOfMom: ; 16218
.AccessBankOfMom: ; 162a8
ld hl, UnknownText_0x1665d
call PrintText
- call LoadStandardMenuDataHeader
- ld hl, MenuDataHeader_0x166b5
- call CopyMenuDataHeader
+ call LoadStandardMenuHeader
+ ld hl, MenuHeader_0x166b5
+ call CopyMenuHeader
call VerticalMenu
call CloseWindow
jr c, .cancel
@@ -145,9 +145,9 @@ Special_BankOfMom: ; 16218
ld [hli], a
ld [hli], a
ld [hl], a
- ld a, $5
+ ld a, 5
ld [wMomBankDigitCursorPosition], a
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call Mom_SetUpDepositMenu
call Mom_Wait10Frames
call Mom_WithdrawDepositMenuJoypad
@@ -212,9 +212,9 @@ Special_BankOfMom: ; 16218
ld [hli], a
ld [hli], a
ld [hl], a
- ld a, $5
+ ld a, 5
ld [wMomBankDigitCursorPosition], a
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call Mom_SetUpWithdrawMenu
call Mom_Wait10Frames
call Mom_WithdrawDepositMenuJoypad
@@ -276,7 +276,7 @@ Special_BankOfMom: ; 16218
call PrintText
call YesNoBox
jr c, .StopSavingMoney
- ld a, $81
+ ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
ld [wMomSavingMoney], a
ld hl, UnknownText_0x16685
call PrintText
@@ -285,7 +285,7 @@ Special_BankOfMom: ; 16218
ret
.StopSavingMoney:
- ld a, $80
+ ld a, 1 << MOM_ACTIVE_F
ld [wMomSavingMoney], a
ld a, $7
ld [wJumptableIndex], a
@@ -727,14 +727,14 @@ Mom_HeldString: ; 166b0
db "HELD@"
; 166b5
-MenuDataHeader_0x166b5: ; 0x166b5
+MenuHeader_0x166b5: ; 0x166b5
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 10, 10
- dw MenuData2_0x166bd
+ dw MenuData_0x166bd
db 1 ; default option
; 0x166bd
-MenuData2_0x166bd: ; 0x166bd
+MenuData_0x166bd: ; 0x166bd
db STATICMENU_CURSOR ; flags
db 4 ; items
db "GET@"
diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm
index 0b35fdb30..de19a3674 100755
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -1,5 +1,5 @@
-NUM_MOM_ITEMS_1 EQUS "((MomItems_1End - MomItems_1) / 8)"
-NUM_MOM_ITEMS_2 EQUS "((MomItems_2End - MomItems_2) / 8)"
+NUM_MOM_ITEMS_1 EQUS "((MomItems_1.End - MomItems_1) / 8)"
+NUM_MOM_ITEMS_2 EQUS "((MomItems_2.End - MomItems_2) / 8)"
const_value = 1
const MOM_ITEM
diff --git a/engine/events/move_deleter.asm b/engine/events/move_deleter.asm
index fad33e222..f75bc44dd 100644
--- a/engine/events/move_deleter.asm
+++ b/engine/events/move_deleter.asm
@@ -1,4 +1,4 @@
-Special_MoveDeletion:
+MoveDeletion:
ld hl, .IntroText
call PrintText
call YesNoBox
@@ -19,7 +19,7 @@ Special_MoveDeletion:
jr z, .onlyonemove
ld hl, .AskWhichMoveText
call PrintText
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall ChooseMoveToDelete
push af
call ReturnToMapWithSpeechTextbox
diff --git a/engine/events/move_tutor.asm b/engine/events/move_tutor.asm
index df599d3ae..c11fe2fa1 100644
--- a/engine/events/move_tutor.asm
+++ b/engine/events/move_tutor.asm
@@ -1,4 +1,4 @@
-Special_MoveTutor: ; 4925b
+MoveTutor: ; 4925b
call FadeToMenu
call ClearBGPalettes
call ClearScreen
@@ -52,8 +52,8 @@ Special_MoveTutor: ; 4925b
ret
CheckCanLearnMoveTutorMove: ; 492b9
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
predef CanLearnTMHMMove
@@ -98,6 +98,6 @@ CheckCanLearnMoveTutorMove: ; 492b9
scf
ret
-.MenuDataHeader: ; 0x4930a
+.MenuHeader: ; 0x4930a
db MENU_BACKUP_TILES ; flags
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
diff --git a/engine/events/name_rater.asm b/engine/events/name_rater.asm
index ad4ea1c9c..aae070ca2 100644
--- a/engine/events/name_rater.asm
+++ b/engine/events/name_rater.asm
@@ -1,4 +1,4 @@
-NameRater: ; fb6ed
+_NameRater: ; fb6ed
; Introduce himself
ld hl, NameRaterIntroText
call PrintText
diff --git a/engine/npctrade.asm b/engine/events/npc_trade.asm
index 7082d5442..7264c310d 100755
--- a/engine/npctrade.asm
+++ b/engine/events/npc_trade.asm
@@ -4,31 +4,31 @@ NPCTrade:: ; fcba8
call Trade_GetDialog
ld b, CHECK_FLAG
call TradeFlagAction
- ld a, TRADE_AFTER
+ ld a, TRADE_DIALOG_AFTER
jr nz, .done
- ld a, TRADE_INTRO
+ ld a, TRADE_DIALOG_INTRO
call PrintTradeText
call YesNoBox
- ld a, TRADE_CANCEL
+ ld a, TRADE_DIALOG_CANCEL
jr c, .done
; Select givemon from party
ld b, PARTYMENUACTION_GIVE_MON
farcall SelectTradeOrDayCareMon
- ld a, TRADE_CANCEL
+ ld a, TRADE_DIALOG_CANCEL
jr c, .done
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [wCurPartySpecies]
cp [hl]
- ld a, TRADE_WRONG
+ ld a, TRADE_DIALOG_WRONG
jr nz, .done
call CheckTradeGender
- ld a, TRADE_WRONG
+ ld a, TRADE_DIALOG_WRONG
jr c, .done
ld b, SET_FLAG
@@ -46,7 +46,7 @@ NPCTrade:: ; fcba8
call RestartMapMusic
- ld a, TRADE_COMPLETE
+ ld a, TRADE_DIALOG_COMPLETE
.done
call PrintTradeText
@@ -72,14 +72,14 @@ CheckTradeGender: ; fcc23
xor a
ld [wMonType], a
- ld e, TRADE_GENDER
+ ld e, NPCTRADE_GENDER
call GetTradeAttribute
ld a, [hl]
- and a ; TRADE_EITHER_GENDER
+ and a ; TRADE_GENDER_EITHER
jr z, .matching
- cp TRADE_MALE_ONLY
+ cp TRADE_GENDER_MALE
jr z, .check_male
-
+ ; TRADE_GENDER_FEMALE
farcall GetGender
jr nz, .not_matching
jr .matching
@@ -108,7 +108,7 @@ TradeFlagAction: ; fcc4a
; fcc59
Trade_GetDialog: ; fcc59
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
ld [wcf64], a
@@ -116,12 +116,12 @@ Trade_GetDialog: ; fcc59
; fcc63
DoNPCTrade: ; fcc63
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
ld [wPlayerTrademonSpecies], a
- ld e, TRADE_GETMON
+ ld e, NPCTRADE_GETMON
call GetTradeAttribute
ld a, [hl]
ld [wOTTrademonSpecies], a
@@ -167,10 +167,10 @@ DoNPCTrade: ; fcc63
ld a, c
ld [wPlayerTrademonCaughtData], a
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
- cp TRADE_DIALOG_GIRL
+ cp TRADE_DIALOGSET_GIRL
ld a, CAUGHT_BY_GIRL
jr c, .okay
ld a, CAUGHT_BY_BOY
@@ -190,17 +190,17 @@ DoNPCTrade: ; fcc63
callfar RemoveMonFromPartyOrBox
predef TryAddMonToParty
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
- cp TRADE_COMPLETE
+ cp TRADE_DIALOG_COMPLETE
ld b, RESET_FLAG
jr c, .incomplete
ld b, SET_FLAG
.incomplete
farcall SetGiftPartyMonCaughtData
- ld e, TRADE_NICK
+ ld e, NPCTRADE_NICK
call GetTradeAttribute
ld de, wOTTrademonNickname
call CopyTradeName
@@ -211,7 +211,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonNickname
call CopyTradeName
- ld e, TRADE_OT_NAME
+ ld e, NPCTRADE_OT_NAME
call GetTradeAttribute
push hl
ld de, wOTTrademonOTName
@@ -226,7 +226,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonOTName
call CopyTradeName
- ld e, TRADE_DVS
+ ld e, NPCTRADE_DVS
call GetTradeAttribute
ld de, wOTTrademonDVs
call Trade_CopyTwoBytes
@@ -237,7 +237,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonDVs
call Trade_CopyTwoBytes
- ld e, TRADE_OT_ID
+ ld e, NPCTRADE_OT_ID
call GetTradeAttribute
ld de, wOTTrademonID + 1
call Trade_CopyTwoBytesReverseEndian
@@ -248,7 +248,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonID
call Trade_CopyTwoBytes
- ld e, TRADE_ITEM
+ ld e, NPCTRADE_ITEM
call GetTradeAttribute
push hl
ld hl, wPartyMon1Item
@@ -359,7 +359,7 @@ Trade_CopyTwoBytesReverseEndian: ; fce15
; fce1b
GetTradeMonNames: ; fce1b
- ld e, TRADE_GETMON
+ ld e, NPCTRADE_GETMON
call GetTradeAttribute
ld a, [hl]
call GetTradeMonName
@@ -367,7 +367,7 @@ GetTradeMonNames: ; fce1b
ld de, wStringBuffer2
call CopyTradeName
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
call GetTradeMonName
@@ -383,16 +383,16 @@ GetTradeMonNames: ; fce1b
dec hl
push hl
- ld e, TRADE_GENDER
+ ld e, NPCTRADE_GENDER
call GetTradeAttribute
ld a, [hl]
pop hl
- and a
+ and a ; TRADE_GENDER_EITHER
ret z
-
- cp TRADE_MALE_ONLY
+ cp TRADE_GENDER_MALE
ld a, "♂"
jr z, .done
+ ; TRADE_GENDER_FEMALE
ld a, "♀"
.done
ld [hli], a
@@ -401,7 +401,7 @@ GetTradeMonNames: ; fce1b
; fce58
-INCLUDE "data/npc_trades.asm"
+INCLUDE "data/events/npc_trades.asm"
PrintTradeText: ; fcf38
@@ -423,28 +423,28 @@ PrintTradeText: ; fcf38
; fcf53
TradeTexts: ; fcf53
-; entries correspond to TRADE_* × TRADE_DIALOG_* constants
-; TRADE_INTRO
+; entries correspond to TRADE_DIALOG_* × TRADE_DIALOGSET_* constants
+; TRADE_DIALOG_INTRO
dw TradeIntroText1
dw TradeIntroText2
dw TradeIntroText3
dw TradeIntroText4
-; TRADE_CANCEL
+; TRADE_DIALOG_CANCEL
dw TradeCancelText1
dw TradeCancelText2
dw TradeCancelText3
dw TradeCancelText4
-; TRADE_WRONG
+; TRADE_DIALOG_WRONG
dw TradeWrongText1
dw TradeWrongText2
dw TradeWrongText3
dw TradeWrongText4
-; TRADE_COMPLETE
+; TRADE_DIALOG_COMPLETE
dw TradeCompleteText1
dw TradeCompleteText2
dw TradeCompleteText3
dw TradeCompleteText4
-; TRADE_AFTER
+; TRADE_DIALOG_AFTER
dw TradeAfterText1
dw TradeAfterText2
dw TradeAfterText3
diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm
index e4efc5c0f..3e58c2677 100644
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -1,4 +1,4 @@
-GiveOddEgg: ; 1fb4b6
+_GiveOddEgg: ; 1fb4b6
; Figure out which egg to give.
; Compare a random word to
@@ -93,4 +93,4 @@ GiveOddEgg: ; 1fb4b6
.Odd:
db "ODD@@@@@@@@@"
-INCLUDE "data/odd_eggs.asm"
+INCLUDE "data/events/odd_eggs.asm"
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm
index 6223d875d..60ed7cdf9 100755
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -277,7 +277,7 @@ CheckOverworldTileArrays: ; c840
ret
-INCLUDE "data/field_move_blocks.asm"
+INCLUDE "data/events/field_move_blocks.asm"
OWFlash: ; c8ac
@@ -358,7 +358,7 @@ SurfFunction: ; c909
call CheckBadge
jr c, .asm_c956
ld hl, wBikeFlags
- bit 1, [hl] ; always on bike
+ bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .cannotsurf
ld a, [wPlayerState]
cp PLAYER_SURF
@@ -421,9 +421,9 @@ UsedSurfScript: ; c986
special ReplaceKrisSprite
special PlayMapMusic
-; step into the water
- special Special_SurfStartStep ; (slow_step_x, step_end)
- applymovement PLAYER, wMovementBuffer ; PLAYER, MovementBuffer
+; step into the water (slow_step DIR, step_end)
+ special SurfStartStep
+ applymovement PLAYER, wMovementBuffer
end
.empty_fn ; c9a2
@@ -520,7 +520,7 @@ TrySurfOW:: ; c9e7
jr c, .quit
ld hl, wBikeFlags
- bit 1, [hl] ; always on bike (can't surf)
+ bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .quit
call GetSurfType
@@ -578,7 +578,7 @@ FlyFunction: ; ca3b
.outdoors
xor a
ld [hMapAnims], a
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearSprites
farcall _FlyMap
ld a, e
@@ -623,7 +623,7 @@ FlyFunction: ; ca3b
special UpdateTimePals
callasm FlyFromAnim
farscall Script_AbortBugContest
- special Special_WarpToSpawnPoint
+ special WarpToSpawnPoint
callasm DelayLoadingNewSprites
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_FLY
@@ -871,7 +871,7 @@ dig_incave
playsound SFX_WARP_TO
applymovement PLAYER, .DigOut
farscall Script_AbortBugContest
- special Special_WarpToSpawnPoint
+ special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_DOOR
playsound SFX_WARP_FROM
@@ -958,7 +958,7 @@ TeleportFunction: ; cc61
playsound SFX_WARP_TO
applymovement PLAYER, .TeleportFrom
farscall Script_AbortBugContest
- special Special_WarpToSpawnPoint
+ special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_TELEPORT
playsound SFX_WARP_FROM
@@ -1008,7 +1008,7 @@ StrengthFunction: ; cce5
SetStrengthFlag: ; cd12
ld hl, wBikeFlags
- set 0, [hl]
+ set BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ld a, [wCurPartyMon]
ld e, a
ld d, 0
@@ -1044,7 +1044,7 @@ Script_UsedStrength: ; 0xcd2d
AskStrengthScript:
callasm TryStrengthOW
iffalse .AskStrength
- if_equal $1, .DontMeetRequirements
+ ifequal $1, .DontMeetRequirements
jump .AlreadyUsedStrength
.DontMeetRequirements: ; 0xcd59
@@ -1086,7 +1086,7 @@ TryStrengthOW: ; cd78
jr c, .nope
ld hl, wBikeFlags
- bit 0, [hl]
+ bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .already_using
ld a, 2
@@ -1413,7 +1413,7 @@ UnknownText_0xcf58: ; 0xcf58
AskRockSmashScript: ; 0xcf5d
callasm HasRockSmash
- if_equal 1, .no
+ ifequal 1, .no
opentext
writetext UnknownText_0xcf77
@@ -1683,7 +1683,7 @@ BikeFunction: ; d0b3
.GetOffBike:
ld hl, wBikeFlags
- bit 1, [hl]
+ bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .CantGetOffBike
ld hl, Script_GetOffBike
ld de, Script_GetOffBike_Register
diff --git a/engine/events/poke_seer.asm b/engine/events/poke_seer.asm
index 85fc7af2d..c79298dd0 100644
--- a/engine/events/poke_seer.asm
+++ b/engine/events/poke_seer.asm
@@ -15,7 +15,7 @@
const SEERACTION_CANT_TELL_2
const SEERACTION_LEVEL_ONLY
-Special_PokeSeer: ; 4f0bc
+PokeSeer: ; 4f0bc
ld a, SEER_INTRO
call PrintSeerText
call JoyWaitAorB
diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm
index 75309aaa1..42284aeab 100755
--- a/engine/events/pokecenter_pc.asm
+++ b/engine/events/pokecenter_pc.asm
@@ -1,4 +1,4 @@
-Special_PokemonCenterPC: ; 1559a
+PokemonCenterPC: ; 1559a
call PC_CheckPartyForPokemon
ret c
call PC_PlayBootSound
@@ -7,7 +7,7 @@ Special_PokemonCenterPC: ; 1559a
ld hl, PokecenterPCText_AccessWhosePC
call PC_DisplayTextWaitMenu
ld hl, .TopMenu
- call LoadMenuDataHeader
+ call LoadMenuHeader
.loop
xor a
ld [hBGMapMode], a
@@ -29,10 +29,10 @@ Special_PokemonCenterPC: ; 1559a
.TopMenu:
db MENU_BACKUP_TILES | MENU_NO_CLICK_SFX ; flags
menu_coords 0, 0, 15, 12
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
-.MenuData2:
+.MenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items
dw .WhichPC
@@ -171,7 +171,7 @@ PC_WaitPlaySFX: ; 156d0
ret
; 156d9
-_KrissHousePC: ; 156d9
+_PlayersHousePC: ; 156d9
call PC_PlayBootSound
ld hl, UnknownText_0x156ff
call PC_DisplayText
@@ -212,8 +212,8 @@ Function15715: ; 15715
xor a
ld [wPCItemsCursor], a
ld [wPCItemsScrollPosition], a
- ld hl, KrissPCMenuData
- call LoadMenuDataHeader
+ ld hl, PlayersPCMenuData
+ call LoadMenuHeader
.asm_15722
call UpdateTimePals
call DoNthMenu
@@ -230,28 +230,28 @@ Function15715: ; 15715
ret
; 15736
-KrissPCMenuData: ; 0x15736
+PlayersPCMenuData: ; 0x15736
db MENU_BACKUP_TILES ; flags
db 0, 0 ; top left corner coords (y, x)
db 12, 15 ; bottom right corner coords (y, x)
- dw .KrissPCMenuData2
+ dw .PlayersPCMenuData
db 1 ; default selected option
-.KrissPCMenuData2:
+.PlayersPCMenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; # items?
- dw .KrissPCMenuList1
+ dw .PlayersPCMenuList1
dw PlaceNthMenuStrings
- dw .KrissPCMenuPointers
+ dw .PlayersPCMenuPointers
-.KrissPCMenuPointers: ; 0x15746
- dw KrisWithdrawItemMenu, .WithdrawItem
- dw KrisDepositItemMenu, .DepositItem
- dw KrisTossItemMenu, .TossItem
- dw KrisMailBoxMenu, .MailBox
- dw KrisDecorationMenu, .Decoration
- dw KrisLogOffMenu, .LogOff
- dw KrisLogOffMenu, .TurnOff
+.PlayersPCMenuPointers: ; 0x15746
+ dw PlayerWithdrawItemMenu, .WithdrawItem
+ dw PlayerDepositItemMenu, .DepositItem
+ dw PlayerTossItemMenu, .TossItem
+ dw PlayerMailBoxMenu, .MailBox
+ dw PlayerDecorationMenu, .Decoration
+ dw PlayerLogOffMenu, .LogOff
+ dw PlayerLogOffMenu, .TurnOff
.WithdrawItem: db "WITHDRAW ITEM@"
.DepositItem: db "DEPOSIT ITEM@"
@@ -269,7 +269,7 @@ DECORATION EQU 4
TURN_OFF EQU 5
LOG_OFF EQU 6
-.KrissPCMenuList1:
+.PlayersPCMenuList1:
db 5
db WITHDRAW_ITEM
db DEPOSIT_ITEM
@@ -278,7 +278,7 @@ LOG_OFF EQU 6
db TURN_OFF
db -1
-.KrissPCMenuList2:
+.PlayersPCMenuList2:
db 6
db WITHDRAW_ITEM
db DEPOSIT_ITEM
@@ -305,8 +305,8 @@ UnknownText_0x157cc: ; 0x157cc
db "@"
; 0x157d1
-KrisWithdrawItemMenu: ; 0x157d1
- call LoadStandardMenuDataHeader
+PlayerWithdrawItemMenu: ; 0x157d1
+ call LoadStandardMenuHeader
farcall ClearPCItemScreen
.loop
call PCItemsJoypad
@@ -370,19 +370,19 @@ KrisWithdrawItemMenu: ; 0x157d1
ret
.HowManyText: ; 0x15850
- text_jump _KrissPCHowManyWithdrawText
+ text_jump _PlayersPCHowManyWithdrawText
db "@"
.WithdrewText: ; 0x15855
- text_jump _KrissPCWithdrewItemsText
+ text_jump _PlayersPCWithdrewItemsText
db "@"
.NoRoomText: ; 0x1585a
- text_jump _KrissPCNoRoomWithdrawText
+ text_jump _PlayersPCNoRoomWithdrawText
db "@"
-KrisTossItemMenu: ; 0x1585f
- call LoadStandardMenuDataHeader
+PlayerTossItemMenu: ; 0x1585f
+ call LoadStandardMenuHeader
farcall ClearPCItemScreen
.loop
call PCItemsJoypad
@@ -397,8 +397,8 @@ KrisTossItemMenu: ; 0x1585f
ret
; 0x1587d
-KrisDecorationMenu: ; 0x1587d
- farcall _KrisDecorationMenu
+PlayerDecorationMenu: ; 0x1587d
+ farcall _PlayerDecorationMenu
ld a, c
and a
ret z
@@ -406,17 +406,17 @@ KrisDecorationMenu: ; 0x1587d
ret
; 0x15888
-KrisLogOffMenu: ; 0x15888
+PlayerLogOffMenu: ; 0x15888
xor a
scf
ret
; 0x1588b
-KrisDepositItemMenu: ; 0x1588b
+PlayerDepositItemMenu: ; 0x1588b
call .CheckItemsInBag
jr c, .nope
call DisableSpriteUpdates
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall DepositSellInitPackBuffers
.loop
farcall DepositSellPack
@@ -532,19 +532,19 @@ KrisDepositItemMenu: ; 0x1588b
ret
.HowManyText: ; 0x1596e
- text_jump _KrissPCHowManyDepositText
+ text_jump _PlayersPCHowManyDepositText
db "@"
.DepositText: ; 0x15973
- text_jump _KrissPCDepositItemsText
+ text_jump _PlayersPCDepositItemsText
db "@"
.NoRoomText: ; 0x15978
- text_jump _KrissPCNoRoomDepositText
+ text_jump _PlayersPCNoRoomDepositText
db "@"
-KrisMailBoxMenu: ; 0x1597d
- farcall _KrisMailBoxMenu
+PlayerMailBoxMenu: ; 0x1597d
+ farcall _PlayerMailBoxMenu
xor a
ret
; 0x15985
@@ -558,7 +558,7 @@ PCItemsJoypad: ; 0x15985
ld a, $0
ld [wSpriteUpdatesEnabled], a
ld hl, .PCItemsMenuData
- call CopyMenuDataHeader
+ call CopyMenuHeader
hlcoord 0, 0
ld b, 10
ld c, 18
@@ -621,10 +621,10 @@ PCItemsJoypad: ; 0x15985
.PCItemsMenuData:
db MENU_BACKUP_TILES ; flags
menu_coords 4, 1, 18, 10
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
-.MenuData2:
+.MenuData:
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 8 ; rows/cols?
db 2 ; horizontal spacing?
diff --git a/engine/events/pokepic.asm b/engine/events/pokepic.asm
index a98ba47d3..e11c45f9b 100755
--- a/engine/events/pokepic.asm
+++ b/engine/events/pokepic.asm
@@ -1,6 +1,6 @@
Pokepic:: ; 244e3
- ld hl, PokepicMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, PokepicMenuHeader
+ call CopyMenuHeader
call MenuBox
call UpdateSprites
call ApplyTilemap
@@ -28,8 +28,8 @@ Pokepic:: ; 244e3
ret
ClosePokepic:: ; 24528
- ld hl, PokepicMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, PokepicMenuHeader
+ call CopyMenuHeader
call ClearMenuBoxInterior
call WaitBGMap
call GetMemSGBLayout
@@ -41,7 +41,7 @@ ClosePokepic:: ; 24528
call LoadStandardFont
ret
-PokepicMenuDataHeader: ; 0x24547
+PokepicMenuHeader: ; 0x24547
db MENU_BACKUP_TILES ; flags
menu_coords 6, 4, 14, 13
dw NULL
diff --git a/engine/events/pokerus/check_pokerus.asm b/engine/events/pokerus/check_pokerus.asm
index d45055ab2..c739c59c5 100644
--- a/engine/events/pokerus/check_pokerus.asm
+++ b/engine/events/pokerus/check_pokerus.asm
@@ -1,4 +1,4 @@
-CheckPokerus: ; 4d860
+_CheckPokerus: ; 4d860
; Return carry if a monster in your party has Pokerus
; Get number of monsters to iterate over
diff --git a/engine/events/pokerus/pokerus.asm b/engine/events/pokerus/pokerus.asm
index b29d0d096..5728cb181 100644
--- a/engine/events/pokerus/pokerus.asm
+++ b/engine/events/pokerus/pokerus.asm
@@ -19,7 +19,7 @@ GivePokerusAndConvertBerries: ; 2ed44
; If we haven't been to Goldenrod City at least once,
; prevent the contraction of Pokerus.
ld hl, wStatusFlags2
- bit 6, [hl]
+ bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
ret z
call Random
ld a, [hRandomAdd]
@@ -61,7 +61,7 @@ GivePokerusAndConvertBerries: ; 2ed44
.TrySpreadPokerus:
call Random
- cp 1 + 33 percent
+ cp 33 percent + 1
ret nc ; 1/3 chance
ld a, [wPartyCount]
@@ -74,7 +74,7 @@ GivePokerusAndConvertBerries: ; 2ed44
jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards
.checkFollowingMonsLoop
add hl, de
@@ -121,14 +121,15 @@ GivePokerusAndConvertBerries: ; 2ed44
ld [hl], a
ret
-; any berry held by a Shuckle may be converted to berry juice
ConvertBerriesToBerryJuice: ; 2ede6
+; If we haven't been to Goldenrod City at least once,
+; prevent Shuckle from turning held Berry into Berry Juice.
ld hl, wStatusFlags2
- bit 6, [hl]
+ bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
ret z
call Random
- cp $10
- ret nc ; 1/16 chance
+ cp 6 percent + 1 ; 1/16 chance
+ ret nc
ld hl, wPartyMons
ld a, [wPartyCount]
.partyMonLoop
diff --git a/engine/events/print_photo.asm b/engine/events/print_photo.asm
index 47766344c..d8350a530 100755
--- a/engine/events/print_photo.asm
+++ b/engine/events/print_photo.asm
@@ -1,4 +1,4 @@
-Special_PhotoStudio: ; 16dc7
+PhotoStudio: ; 16dc7
ld hl, .Text_AskWhichMon
call PrintText
farcall SelectMonFromParty
diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm
index b0b7e856a..f8fa52af3 100644
--- a/engine/events/print_unown.asm
+++ b/engine/events/print_unown.asm
@@ -1,4 +1,4 @@
-UnownPrinter: ; 16be4
+_UnownPrinter: ; 16be4
ld a, [wUnownDex]
and a
ret z
diff --git a/engine/events/print_unown_2.asm b/engine/events/print_unown_2.asm
index 4583a59e0..78611e594 100644
--- a/engine/events/print_unown_2.asm
+++ b/engine/events/print_unown_2.asm
@@ -98,10 +98,10 @@ RotateUnownFrontpic: ; e0000
overworldmaprect: MACRO
y = 0
rept \1
-x = \1 * (\2 +- 1) + y
+x = \1 * (\2 + -1) + y
rept \2
dw wOverworldMap tile x
-x = x +- \2
+x = x + -\2
endr
y = y + 1
endr
diff --git a/engine/events/prof_oaks_pc.asm b/engine/events/prof_oaks_pc.asm
index 5dca38efe..b80efe75b 100755
--- a/engine/events/prof_oaks_pc.asm
+++ b/engine/events/prof_oaks_pc.asm
@@ -3,7 +3,7 @@ ProfOaksPC: ; 0x265d3
call MenuTextBox
call YesNoBox
jr c, .shutdown
- call Special_ProfOaksPCBoot ; player chose "yes"?
+ call ProfOaksPCBoot ; player chose "yes"?
.shutdown
ld hl, OakPCText4
call PrintText
@@ -11,7 +11,7 @@ ProfOaksPC: ; 0x265d3
call ExitMenu
ret
-Special_ProfOaksPCBoot ; 0x265ee
+ProfOaksPCBoot ; 0x265ee
ld hl, OakPCText2
call PrintText
call Rate
@@ -98,27 +98,7 @@ endr
ld l, a
ret
-OakRatings: ; 0x2667f
-; if you caught at most this many, play this sound, load this text
- dbww 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
- dbww 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
- dbww 34, SFX_DEX_FANFARE_20_49, OakRating03
- dbww 49, SFX_DEX_FANFARE_20_49, OakRating04
- dbww 64, SFX_DEX_FANFARE_50_79, OakRating05
- dbww 79, SFX_DEX_FANFARE_50_79, OakRating06
- dbww 94, SFX_DEX_FANFARE_80_109, OakRating07
- dbww 109, SFX_DEX_FANFARE_80_109, OakRating08
- dbww 124, SFX_CAUGHT_MON, OakRating09
- dbww 139, SFX_CAUGHT_MON, OakRating10
- dbww 154, SFX_DEX_FANFARE_140_169, OakRating11
- dbww 169, SFX_DEX_FANFARE_140_169, OakRating12
- dbww 184, SFX_DEX_FANFARE_170_199, OakRating13
- dbww 199, SFX_DEX_FANFARE_170_199, OakRating14
- dbww 214, SFX_DEX_FANFARE_200_229, OakRating15
- dbww 229, SFX_DEX_FANFARE_200_229, OakRating16
- dbww 239, SFX_DEX_FANFARE_230_PLUS, OakRating17
- dbww 248, SFX_DEX_FANFARE_230_PLUS, OakRating18
- dbww 255, SFX_DEX_FANFARE_230_PLUS, OakRating19
+INCLUDE "data/events/pokedex_ratings.asm"
OakPCText1: ; 0x266de
text_jump _OakPCText1
diff --git a/engine/events/sacred_ash.asm b/engine/events/sacred_ash.asm
index cf305355a..2cb5e37a1 100755
--- a/engine/events/sacred_ash.asm
+++ b/engine/events/sacred_ash.asm
@@ -52,12 +52,12 @@ SacredAshScript: ; 0x50821
special HealParty
reloadmappart
playsound SFX_WARP_TO
- special Special_FadeOutPalettes
- special Special_FadeInPalettes
- special Special_FadeOutPalettes
- special Special_FadeInPalettes
- special Special_FadeOutPalettes
- special Special_FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
+ special FadeOutPalettes
+ special FadeInPalettes
waitsfx
writetext UnknownText_0x50845
playsound SFX_CAUGHT_MON
diff --git a/engine/events/special.asm b/engine/events/special.asm
index 081606512..62955c3e9 100755
--- a/engine/events/special.asm
+++ b/engine/events/special.asm
@@ -1,6 +1,6 @@
MANIA_OT_ID EQU 00518
-Special_GiveShuckle: ; 7305
+GiveShuckle: ; 7305
; Adding to the party.
xor a
@@ -56,7 +56,7 @@ Special_GiveShuckle: ; 7305
; Engine flag for this event.
ld hl, wDailyFlags
- set 5, [hl] ; ENGINE_SHUCKLE_GIVEN
+ set DAILYFLAGS_GOT_SHUCKIE_TODAY_F, [hl]
ld a, 1
ld [wScriptVar], a
ret
@@ -71,7 +71,7 @@ SpecialShuckleOT:
SpecialShuckleNick:
db "SHUCKIE@"
-Special_ReturnShuckle: ; 737e
+ReturnShuckle: ; 737e
farcall SelectMonFromParty
jr c, .refused
@@ -141,7 +141,7 @@ Special_ReturnShuckle: ; 737e
ld [wScriptVar], a
ret
-Special_BillsGrandfather: ; 73f7
+BillsGrandfather: ; 73f7
farcall SelectMonFromParty
jr c, .cancel
ld a, [wCurPartySpecies]
@@ -155,18 +155,19 @@ Special_BillsGrandfather: ; 73f7
ld [wScriptVar], a
ret
-Special_YoungerHaircutBrother: ; 7413
- ld hl, Data_YoungerHaircutBrother
- jr MassageOrHaircut
+YoungerHaircutBrother: ; 7413
+ ld hl, HappinessData_YoungerHaircutBrother
+ jr HaircutOrGrooming
-Special_OlderHaircutBrother: ; 7418
- ld hl, Data_OlderHaircutBrother
- jr MassageOrHaircut
+OlderHaircutBrother: ; 7418
+ ld hl, HappinessData_OlderHaircutBrother
+ jr HaircutOrGrooming
-Special_DaisyMassage: ; 741d
- ld hl, Data_DaisyMassage
+DaisysGrooming: ; 741d
+ ld hl, HappinessData_DaisysGrooming
+ ; fallthrough
-MassageOrHaircut: ; 7420
+HaircutOrGrooming: ; 7420
push hl
farcall SelectMonFromParty
pop hl
@@ -181,7 +182,7 @@ MassageOrHaircut: ; 7420
call Random
; Bug: Subtracting $ff from $ff fails to set c.
; This can result in overflow into the next data array.
-; In the case of getting a massage from Daisy, we bleed
+; In the case of getting a grooming from Daisy, we bleed
; into CopyPokemonName_Buffer1_Buffer3, which passes
; $d0 to ChangeHappiness and returns $73 to the script.
; The end result is that there is a 0.4% chance your
@@ -212,18 +213,7 @@ MassageOrHaircut: ; 7420
ld [wScriptVar], a
ret
-Data_YoungerHaircutBrother: ; 7459
- db $4c, 2, HAPPINESS_YOUNGCUT1 ; 30% chance
- db $80, 3, HAPPINESS_YOUNGCUT2 ; 20% chance
- db $ff, 4, HAPPINESS_YOUNGCUT3 ; 50% chance
-
-Data_OlderHaircutBrother: ; 7462
- db $9a, 2, HAPPINESS_OLDERCUT1 ; 60% chance
- db $4c, 3, HAPPINESS_OLDERCUT2 ; 10% chance
- db $ff, 4, HAPPINESS_OLDERCUT3 ; 30% chance
-
-Data_DaisyMassage: ; 746b
- db $ff, 2, HAPPINESS_MASSAGE ; 99.6% chance
+INCLUDE "data/events/happiness_chances.asm"
CopyPokemonName_Buffer1_Buffer3: ; 746e
ld hl, wStringBuffer1
diff --git a/engine/events/std_collision.asm b/engine/events/std_collision.asm
index 79dbc71f1..775f7c10c 100644
--- a/engine/events/std_collision.asm
+++ b/engine/events/std_collision.asm
@@ -23,7 +23,7 @@ CheckFacingTileForStdScript:: ; 1365b
xor a
ret
-INCLUDE "data/collision_stdscripts.asm"
+INCLUDE "data/events/collision_stdscripts.asm"
Script_JumpStdFromRAM: ; 0x1369a
jump wJumpStdScriptBuffer
diff --git a/engine/events/std_scripts.asm b/engine/events/std_scripts.asm
index 216ce0058..e3dbd92df 100644
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -57,11 +57,11 @@ PokecenterNurseScript:
; EVENT_WELCOMED_TO_POKECOM_CENTER is never set
opentext
- checkmorn
+ checktime MORN
iftrue .morn
- checkday
+ checktime DAY
iftrue .day
- checknite
+ checktime NITE
iftrue .nite
jump .ok
@@ -108,23 +108,23 @@ PokecenterNurseScript:
farwritetext NurseTakePokemonText
pause 20
- special Special_StubbedTrainerRankings_Healings
- spriteface LAST_TALKED, LEFT
+ special StubbedTrainerRankings_Healings
+ objectface LAST_TALKED, LEFT
pause 10
special HealParty
playmusic MUSIC_NONE
writebyte HEALMACHINE_POKECENTER
- special Special_HealMachineAnim
+ special HealMachineAnim
pause 30
special RestartMapMusic
- spriteface LAST_TALKED, DOWN
+ objectface LAST_TALKED, DOWN
pause 10
checkphonecall ; elm already called about pokerus
iftrue .no
- checkflag ENGINE_POKERUS ; nurse already talked about pokerus
+ checkflag ENGINE_CAUGHT_POKERUS
iftrue .no
- special Special_CheckPokerus
+ special CheckPokerus
iftrue .pokerus
.no
@@ -134,9 +134,9 @@ PokecenterNurseScript:
.done
farwritetext NurseGoodbyeText
- spriteface LAST_TALKED, UP
+ objectface LAST_TALKED, UP
pause 10
- spriteface LAST_TALKED, DOWN
+ objectface LAST_TALKED, DOWN
pause 10
waitbutton
@@ -158,7 +158,7 @@ PokecenterNurseScript:
closetext
.pokerus_done
- setflag ENGINE_POKERUS
+ setflag ENGINE_CAUGHT_POKERUS
specialphonecall SPECIALCALL_POKERUS
end
@@ -184,7 +184,7 @@ TownMapScript:
opentext
farwritetext TownMapText
waitbutton
- special Special_TownMap
+ special OverworldTownMap
closetext
end
@@ -204,7 +204,7 @@ HomepageScript:
Radio1Script:
opentext
writebyte MAPRADIO_POKEMON_CHANNEL
- special Special_MapRadio
+ special MapRadio
closetext
end
@@ -212,7 +212,7 @@ Radio2Script:
; Lucky Channel
opentext
writebyte MAPRADIO_LUCKY_CHANNEL
- special Special_MapRadio
+ special MapRadio
closetext
end
@@ -221,7 +221,7 @@ TrashCanScript: ; 0xbc1a5
PCScript:
opentext
- special Special_PokemonCenterPC
+ special PokemonCenterPC
closetext
end
@@ -245,12 +245,12 @@ MartSignScript
DayToTextScript:
checkcode VAR_WEEKDAY
- if_equal MONDAY, .Monday
- if_equal TUESDAY, .Tuesday
- if_equal WEDNESDAY, .Wednesday
- if_equal THURSDAY, .Thursday
- if_equal FRIDAY, .Friday
- if_equal SATURDAY, .Saturday
+ ifequal MONDAY, .Monday
+ ifequal TUESDAY, .Tuesday
+ ifequal WEDNESDAY, .Wednesday
+ ifequal THURSDAY, .Thursday
+ ifequal FRIDAY, .Friday
+ ifequal SATURDAY, .Saturday
stringtotext .SundayText, MEM_BUFFER_0
end
.Monday:
@@ -298,7 +298,7 @@ RadioTowerRocketsScript:
clearevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
setevent EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST
specialphonecall SPECIALCALL_WEIRDBROADCAST
- setmapscene MAHOGANY_TOWN, 1
+ setmapscene MAHOGANY_TOWN, SCENE_FINISHED
end
BugContestResultsWarpScript:
@@ -320,11 +320,11 @@ BugContestResultsScript:
opentext
farwritetext ContestResults_ReadyToJudgeText
waitbutton
- special Special_BugContestJudging
+ special BugContestJudging
vartomem MEM_BUFFER_0
- if_equal 1, BugContestResults_FirstPlace
- if_equal 2, BugContestResults_SecondPlace
- if_equal 3, BugContestResults_ThirdPlace
+ ifequal 1, BugContestResults_FirstPlace
+ ifequal 2, BugContestResults_SecondPlace
+ ifequal 3, BugContestResults_ThirdPlace
farwritetext ContestResults_ConsolationPrizeText
buttonsound
waitsfx
@@ -346,18 +346,18 @@ BugContestResults_FinishUp
iffalse BugContestResults_DidNotLeaveMons
farwritetext ContestResults_ReturnPartyText
waitbutton
- special Special_ContestReturnMons
+ special ContestReturnMons
BugContestResults_DidNotLeaveMons
- special Special_CheckPartyFullAfterContest
- if_equal BUGCONTEST_CAUGHT_MON, BugContestResults_CleanUp
- if_equal BUGCONTEST_NO_CATCH, BugContestResults_CleanUp
+ special CheckPartyFullAfterContest
+ ifequal BUGCONTEST_CAUGHT_MON, BugContestResults_CleanUp
+ ifequal BUGCONTEST_NO_CATCH, BugContestResults_CleanUp
; BUGCONTEST_BOXED_MON
farwritetext ContestResults_PartyFullText
waitbutton
BugContestResults_CleanUp
closetext
- setscene 0
- setmapscene ROUTE_35_NATIONAL_PARK_GATE, 0
+ setscene SCENE_ROUTE36NATIONALPARKGATE_NOTHING
+ setmapscene ROUTE_35_NATIONAL_PARK_GATE, SCENE_ROUTE35NATIONALPARKGATE_NOTHING
setevent EVENT_BUG_CATCHING_CONTESTANT_1A
setevent EVENT_BUG_CATCHING_CONTESTANT_2A
setevent EVENT_BUG_CATCHING_CONTESTANT_3A
@@ -384,7 +384,7 @@ BugContestResults_CleanUp
; 0xbc31e
BugContestResults_FirstPlace ; 0xbc31e
- setevent EVENT_GAVE_KURT_APRICORNS
+ setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
itemtotext SUN_STONE, MEM_BUFFER_1
farwritetext ContestResults_PlayerWonAPrizeText
waitbutton
@@ -539,10 +539,10 @@ InitializeEventsScript:
setevent EVENT_MAHOGANY_MART_OWNERS
setevent EVENT_TIN_TOWER_ROOF_HO_OH
setevent EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA
- setevent EVENT_KRISS_HOUSE_2F_CONSOLE
- setevent EVENT_KRISS_HOUSE_2F_DOLL_1
- setevent EVENT_KRISS_HOUSE_2F_DOLL_2
- setevent EVENT_KRISS_HOUSE_2F_BIG_DOLL
+ setevent EVENT_PLAYERS_HOUSE_2F_CONSOLE
+ setevent EVENT_PLAYERS_HOUSE_2F_DOLL_1
+ setevent EVENT_PLAYERS_HOUSE_2F_DOLL_2
+ setevent EVENT_PLAYERS_HOUSE_2F_BIG_DOLL
setevent EVENT_DECO_BED_1
setevent EVENT_DECO_PLANT_4
setevent EVENT_GOLDENROD_TRAIN_STATION_GENTLEMAN
@@ -576,7 +576,7 @@ InitializeEventsScript:
setevent EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS
setevent EVENT_DRAGON_SHRINE_CLAIR
setevent EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER
- setevent EVENT_KRISS_NEIGHBORS_HOUSE_NEIGHBOR
+ setevent EVENT_PLAYERS_NEIGHBORS_HOUSE_NEIGHBOR
setevent EVENT_AZALEA_TOWN_KURT
setevent EVENT_AZALEA_TOWN_KURT
setevent EVENT_ILEX_FOREST_KURT
@@ -585,7 +585,7 @@ InitializeEventsScript:
setevent EVENT_GOLDENROD_SALE_OFF
setevent EVENT_ECRUTEAK_CITY_GRAMPS
setevent EVENT_EUSINE_IN_BURNED_TOWER
- setevent EVENT_KRISS_HOUSE_MOM_2
+ setevent EVENT_PLAYERS_HOUSE_MOM_2
setevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2
setevent EVENT_CIANWOOD_CITY_EUSINE
setevent EVENT_TIN_TOWER_1F_EUSINE
@@ -622,28 +622,28 @@ InitializeEventsScript:
return
AskNumber1MScript:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackAskNumber1Text
@@ -707,28 +707,28 @@ AskNumber1MScript:
end
AskNumber2MScript:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackAskNumber2Text
@@ -800,26 +800,26 @@ RegisteredNumberMScript:
NumberAcceptedMScript:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackNumberAcceptedText
@@ -924,26 +924,26 @@ NumberAcceptedMScript:
NumberDeclinedMScript:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackNumberDeclinedText
@@ -1048,26 +1048,26 @@ NumberDeclinedMScript:
PhoneFullMScript:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackPhoneFullText
@@ -1172,23 +1172,23 @@ PhoneFullMScript:
RematchMScript:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackRematchText
@@ -1278,13 +1278,13 @@ RematchMScript:
GiftMScript:
checkcode VAR_CALLERID
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
.Jose:
farwritetext JoseGiftText
@@ -1317,17 +1317,17 @@ GiftMScript:
PackFullMScript:
checkcode VAR_CALLERID
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Huey:
farwritetext HueyPackFullText
@@ -1388,10 +1388,10 @@ PackFullMScript:
RematchGiftMScript:
opentext
checkcode VAR_CALLERID
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_HIKER_PARRY, .Parry
.Huey:
farwritetext HueyRematchGiftText
@@ -1412,14 +1412,14 @@ RematchGiftMScript:
AskNumber1FScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyAskNumber1Text
@@ -1448,14 +1448,14 @@ AskNumber1FScript:
AskNumber2FScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyAskNumber2Text
@@ -1491,14 +1491,14 @@ RegisteredNumberFScript:
NumberAcceptedFScript: ; 0xbcbd3
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyNumberAcceptedText
@@ -1543,14 +1543,14 @@ NumberAcceptedFScript: ; 0xbcbd3
NumberDeclinedFScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyNumberDeclinedText
@@ -1595,14 +1595,14 @@ NumberDeclinedFScript:
PhoneFullFScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyPhoneFullText
@@ -1647,13 +1647,13 @@ PhoneFullFScript:
RematchFScript:
checkcode VAR_CALLERID
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beth:
farwritetext BethRematchText
@@ -1693,10 +1693,10 @@ RematchFScript:
GiftFScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
.Beverly:
farwritetext BeverlyGiftText
@@ -1717,11 +1717,11 @@ GiftFScript:
PackFullFScript:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext BeverlyPackFullText
@@ -1751,7 +1751,7 @@ PackFullFScript:
RematchGiftFScript:
checkcode VAR_CALLERID
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Erin:
opentext
@@ -1810,20 +1810,20 @@ CoinVendor_IntroScript: ; 0xbcde0
farwritetext CoinVendor_IntroText
.loop ; 0xbcde4
- special Special_DisplayMoneyAndCoinBalance
- loadmenudata .MenuDataHeader
+ special DisplayMoneyAndCoinBalance
+ loadmenuheader .MenuHeader
verticalmenu
closewindow
- if_equal 1, .Buy50
- if_equal 2, .Buy500
+ ifequal 1, .Buy50
+ ifequal 2, .Buy500
jump .Cancel
; 0xbcdf7
.Buy50: ; 0xbcdf7
checkcoins MAX_COINS - 50
- if_equal HAVE_MORE, .CoinCaseFull
+ ifequal HAVE_MORE, .CoinCaseFull
checkmoney YOUR_MONEY, 1000
- if_equal HAVE_LESS, .NotEnoughMoney
+ ifequal HAVE_LESS, .NotEnoughMoney
givecoins 50
takemoney YOUR_MONEY, 1000
waitsfx
@@ -1835,9 +1835,9 @@ CoinVendor_IntroScript: ; 0xbcde0
.Buy500: ; 0xbce1b
checkcoins MAX_COINS - 500
- if_equal HAVE_MORE, .CoinCaseFull
+ ifequal HAVE_MORE, .CoinCaseFull
checkmoney YOUR_MONEY, 10000
- if_equal HAVE_LESS, .NotEnoughMoney
+ ifequal HAVE_LESS, .NotEnoughMoney
givecoins 500
takemoney YOUR_MONEY, 10000
waitsfx
@@ -1869,13 +1869,13 @@ CoinVendor_IntroScript: ; 0xbcde0
; 0xbce54
-.MenuDataHeader:
+.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 4, 15, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
-.MenuData2:
+.MenuData:
db STATICMENU_CURSOR ; flags
db 3 ; items
db " 50 : ¥1000@"
@@ -1887,9 +1887,9 @@ CoinVendor_IntroScript: ; 0xbcde0
HappinessCheckScript:
faceplayer
opentext
- special Special_GetFirstPokemonHappiness
- if_less_than 50, .Unhappy
- if_less_than 150, .KindaHappy
+ special GetFirstPokemonHappiness
+ ifless 50, .Unhappy
+ ifless 150, .KindaHappy
farwritetext HappinessText3
waitbutton
closetext
diff --git a/engine/events/sweet_scent.asm b/engine/events/sweet_scent.asm
index 2f1759a2b..509d9775d 100755
--- a/engine/events/sweet_scent.asm
+++ b/engine/events/sweet_scent.asm
@@ -37,7 +37,7 @@ SweetScentEncounter: ; 506ef
farcall CanUseSweetScent
jr nc, .no_battle
ld hl, wStatusFlags2
- bit 2, [hl]
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .not_in_bug_contest
farcall GetMapEncounterRate
ld a, b
diff --git a/engine/events/unown_walls.asm b/engine/events/unown_walls.asm
index 5cc241966..64558167a 100644
--- a/engine/events/unown_walls.asm
+++ b/engine/events/unown_walls.asm
@@ -1,9 +1,9 @@
-Special_HoOhChamber: ; 0x8addb
+HoOhChamber: ; 0x8addb
ld hl, wPartySpecies
ld a, [hl]
cp HO_OH ; is Ho-oh the first Pokémon in the party?
jr nz, .done ; if not, we're done
- call GetMapDataPointer ; pointless?
+ call GetMapAttributesPointer ; pointless?
ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
ld b, SET_FLAG
call EventFlagAction
@@ -11,8 +11,8 @@ Special_HoOhChamber: ; 0x8addb
ret
; 0x8adef
-Special_OmanyteChamber: ; 8adef
- call GetMapDataPointer ; pointless?
+OmanyteChamber: ; 8adef
+ call GetMapAttributesPointer ; pointless?
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, CHECK_FLAG
call EventFlagAction
@@ -44,7 +44,7 @@ Special_OmanyteChamber: ; 8adef
jr nz, .loop
.open
- call GetMapDataPointer ; pointless?
+ call GetMapAttributesPointer ; pointless?
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, SET_FLAG
call EventFlagAction
@@ -57,12 +57,12 @@ SpecialAerodactylChamber: ; 8ae30
push de
push bc
- call GetMapDataPointer
+ call GetMapAttributesPointer
ld a, h
- cp HIGH(RuinsOfAlphAerodactylChamber_MapData)
+ cp HIGH(RuinsOfAlphAerodactylChamber_MapAttributes)
jr nz, .nope
ld a, l
- cp LOW(RuinsOfAlphAerodactylChamber_MapData)
+ cp LOW(RuinsOfAlphAerodactylChamber_MapAttributes)
jr nz, .nope
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
@@ -85,12 +85,12 @@ SpecialKabutoChamber: ; 8ae4e
push hl
push de
- call GetMapDataPointer
+ call GetMapAttributesPointer
ld a, h
- cp HIGH(RuinsOfAlphKabutoChamber_MapData)
+ cp HIGH(RuinsOfAlphKabutoChamber_MapAttributes)
jr nz, .done
ld a, l
- cp LOW(RuinsOfAlphKabutoChamber_MapData)
+ cp LOW(RuinsOfAlphKabutoChamber_MapAttributes)
jr nz, .done
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
@@ -103,9 +103,9 @@ SpecialKabutoChamber: ; 8ae4e
ret
; 8ae68
-Special_DisplayUnownWords: ; 8ae68
+DisplayUnownWords: ; 8ae68
ld a, [wScriptVar]
- ld hl, MenuDataHeaders_UnownWalls
+ ld hl, MenuHeaders_UnownWalls
and a
jr z, .load
@@ -117,7 +117,7 @@ Special_DisplayUnownWords: ; 8ae68
jr nz, .loop
.load
- call LoadMenuDataHeader
+ call LoadMenuHeader
xor a
ld [hBGMapMode], a
call MenuBox
@@ -153,7 +153,7 @@ Special_DisplayUnownWords: ; 8ae68
ret
; 8aebc
-INCLUDE "data/unown_walls.asm"
+INCLUDE "data/events/unown_walls.asm"
_DisplayUnownWords_FillAttr: ; 8aee9
ld a, [de]
diff --git a/engine/events/whiteout.asm b/engine/events/whiteout.asm
index 4adef9f4f..4bf656055 100755
--- a/engine/events/whiteout.asm
+++ b/engine/events/whiteout.asm
@@ -10,7 +10,7 @@ Script_OverworldWhiteout:: ; 0x124c8
Script_Whiteout: ; 0x124ce
writetext .WhitedOutText
waitbutton
- special Special_FadeOutPalettes
+ special FadeOutPalettes
pause 40
special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER
@@ -18,9 +18,9 @@ Script_Whiteout: ; 0x124ce
callasm HalveMoney
callasm GetWhiteoutSpawn
farscall Script_AbortBugContest
- special Special_WarpToSpawnPoint
+ special WarpToSpawnPoint
newloadmap MAPSETUP_WARP
- end_all
+ endall
.bug_contest
jumpstd bugcontestresultswarp
diff --git a/engine/events_2.asm b/engine/events_2.asm
index b43ebdd6a..6e106541a 100644
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -1,10 +1,10 @@
; More overworld event handling.
-Special_WarpToSpawnPoint:: ; 97c28
+WarpToSpawnPoint:: ; 97c28
ld hl, wStatusFlags2
- res 1, [hl] ; safari zone?
- res 2, [hl] ; bug contest
+ res STATUSFLAGS2_SAFARI_GAME_F, [hl]
+ res STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ret
; 97c30
@@ -109,7 +109,7 @@ RandomEncounter:: ; 97cc0
call CanUseSweetScent
jr nc, .nope
ld hl, wStatusFlags2
- bit 2, [hl] ; bug contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .bug_contest
farcall TryWildEncounter
jr nz, .nope
@@ -150,7 +150,7 @@ WildBattleScript: ; 97cf9
CanUseSweetScent:: ; 97cfd
ld hl, wStatusFlags
- bit 5, [hl]
+ bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
jr nz, .no
ld a, [wEnvironment]
cp CAVE
@@ -264,7 +264,7 @@ DoBikeStep:: ; 97db3
; if we've already gotten the call, we don't have to
; be here.
ld hl, wStatusFlags2
- bit 4, [hl] ; bike shop call
+ bit STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
jr z, .NoCall
; If we're not on the bike, we don't have to be here.
@@ -315,7 +315,7 @@ DoBikeStep:: ; 97db3
xor a
ld [wSpecialPhoneCallID + 1], a
ld hl, wStatusFlags2
- res 4, [hl] ; bike shop call
+ res STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
scf
ret
diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm
index e78423ef1..978f9e968 100755
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -352,7 +352,7 @@ EvolutionAnimation: ; 4e5e1
ld a, [hl]
or b
ld [hli], a ; attributes
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
dec c
diff --git a/engine/init_gender.asm b/engine/init_gender.asm
index 945e9f61f..8fd95bc85 100755
--- a/engine/init_gender.asm
+++ b/engine/init_gender.asm
@@ -30,8 +30,8 @@ InitGender: ; 48dcb (12:4dcb)
call SetPalettes
ld hl, TextJump_AreYouABoyOrAreYouAGirl
call PrintText
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call WaitBGMap2
call VerticalMenu
call CloseWindow
@@ -43,14 +43,14 @@ InitGender: ; 48dcb (12:4dcb)
ret
; 48dfc (12:4dfc)
-.MenuDataHeader: ; 0x48dfc
+.MenuHeader: ; 0x48dfc
db MENU_BACKUP_TILES ; flags
menu_coords 6, 4, 12, 9
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x48e04
-.MenuData2: ; 0x48e04
+.MenuData: ; 0x48e04
db STATICMENU_CURSOR | STATICMENU_WRAP | STATICMENU_DISABLE_B ; flags
db 2 ; items
db "Boy@"
diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm
index 74daec6d8..af6e0c09e 100755
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -352,7 +352,7 @@ Continue: ; 5d65
farcall TryLoadSaveFile
jr c, .FailToLoad
farcall _LoadData
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call DisplaySaveInfoOnContinue
ld a, $1
ld [hBGMapMode], a
@@ -484,8 +484,8 @@ FinishContinueFunction: ; 5e5d
ld [wDontPlayMapMusicOnReload], a
ld [wLinkMode], a
ld hl, wGameTimerPause
- set 0, [hl]
- res 7, [hl]
+ set GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
+ res GAMETIMERPAUSE_MOBILE_7_F, [hl]
ld hl, wEnteredMapFromContinue
set 1, [hl]
farcall OverworldLoop
@@ -539,27 +539,27 @@ DisplayContinueDataWithRTCError: ; 5eaf
Continue_LoadMenuHeader: ; 5ebf
xor a
ld [hBGMapMode], a
- ld hl, .MenuDataHeader_Dex
+ ld hl, .MenuHeader_Dex
ld a, [wStatusFlags]
- bit 0, a ; pokedex
+ bit STATUSFLAGS_POKEDEX_F, a
jr nz, .show_menu
- ld hl, .MenuDataHeader_NoDex
+ ld hl, .MenuHeader_NoDex
.show_menu
- call _OffsetMenuDataHeader
+ call _OffsetMenuHeader
call MenuBox
call PlaceVerticalMenuItems
ret
; 5ed9
-.MenuDataHeader_Dex: ; 5ed9
+.MenuHeader_Dex: ; 5ed9
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 15, 9
- dw .MenuData2_Dex
+ dw .MenuData_Dex
db 1 ; default option
; 5ee1
-.MenuData2_Dex: ; 5ee1
+.MenuData_Dex: ; 5ee1
db 0 ; flags
db 4 ; items
db "PLAYER@"
@@ -568,14 +568,14 @@ Continue_LoadMenuHeader: ; 5ebf
db "TIME@"
; 5efb
-.MenuDataHeader_NoDex: ; 5efb
+.MenuHeader_NoDex: ; 5efb
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 15, 9
- dw .MenuData2_NoDex
+ dw .MenuData_NoDex
db 1 ; default option
; 5f03
-.MenuData2_NoDex: ; 5f03
+.MenuData_NoDex: ; 5f03
db 0 ; flags
db 4 ; items
db "PLAYER <PLAYER>@"
@@ -640,7 +640,7 @@ Continue_DisplayBadgeCount: ; 5f58
Continue_DisplayPokedexNumCaught: ; 5f6b
ld a, [wStatusFlags]
- bit 0, a ; Pokedex
+ bit STATUSFLAGS_POKEDEX_F, a
ret z
push hl
ld hl, wPokedexCaught
@@ -812,7 +812,7 @@ NamePlayer: ; 0x6074
ld hl, wPlayerName
ld de, .Chris
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .Male
ld de, .Kris
.Male:
@@ -826,7 +826,7 @@ NamePlayer: ; 0x6074
; 60e9
Unreferenced_Function60e9:
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
ld a, [wMenuCursorY]
dec a
@@ -902,7 +902,7 @@ ShrinkPlayer: ; 610f
Intro_RotatePalettesLeftFrontpic: ; 616a
ld hl, IntroFadePalettes
- ld b, IntroFadePalettesEnd - IntroFadePalettes
+ ld b, IntroFadePalettes.End - IntroFadePalettes
.loop
ld a, [hli]
call DmgToCgbBGPals
@@ -920,7 +920,7 @@ IntroFadePalettes: ; 0x617c
db %11111000
db %11110100
db %11100100
-IntroFadePalettesEnd
+.End
; 6182
Intro_WipeInFrontpic: ; 6182
@@ -988,7 +988,7 @@ Intro_PlacePlayerSprite: ; 61cd
ld b, PAL_OW_RED
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld b, PAL_OW_BLUE
.male
diff --git a/engine/item_effects.asm b/engine/item_effects.asm
index 114b2cb70..4302b3ba1 100644
--- a/engine/item_effects.asm
+++ b/engine/item_effects.asm
@@ -355,33 +355,25 @@ ParkBall: ; e8a2
ld a, $ff
.max_1
+ ; BUG: farcall overwrites a, and GetItemHeldEffect takes b anyway.
+ ; This is probably the reason the HELD_CATCH_CHANCE effect is never used.
+ ; Uncomment the line below to fix.
ld d, a
push de
-
- ; BUG: farcall overwrites a,
- ; and GetItemHeldEffect takes b anyway.
-
- ; This is probably the reason
- ; the HELD_CATCH_CHANCE effect
- ; is never used.
-
- ; Uncomment the line below to fix.
-
ld a, [wBattleMonItem]
; ld b, a
farcall GetItemHeldEffect
ld a, b
cp HELD_CATCH_CHANCE
-
pop de
ld a, d
-
- jr nz, .skip_hp_calc
+ jr nz, .max_2
add c
- jr nc, .skip_hp_calc
+ jr nc, .max_2
ld a, $ff
-.skip_hp_calc
+.max_2
+.skip_hp_calc
ld b, a
ld [wBuffer1], a
call Random
diff --git a/engine/items.asm b/engine/items.asm
index 7246d5609..c07042aed 100755
--- a/engine/items.asm
+++ b/engine/items.asm
@@ -11,6 +11,7 @@ _ReceiveItem:: ; d1d5
ret
.Pockets: ; d1e9
+; entries correspond to item types
dw .Item
dw .KeyItem
dw .Ball
@@ -51,6 +52,7 @@ _TossItem:: ; d20d
ret
.Pockets:
+; entries correspond to item types
dw .Item
dw .KeyItem
dw .Ball
@@ -93,6 +95,7 @@ _CheckItem:: ; d244
ret
.Pockets:
+; entries correspond to item types
dw .Item
dw .KeyItem
dw .Ball
@@ -492,7 +495,7 @@ _CheckTossableItem:: ; d427
; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be removed from the bag.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
- bit 7, a
+ bit CANT_TOSS_F, a
jr nz, ItemAttr_ReturnCarry
and a
ret
@@ -501,7 +504,7 @@ CheckSelectableItem: ; d432
; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be selected.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
- bit 6, a
+ bit CANT_SELECT_F, a
jr nz, ItemAttr_ReturnCarry
and a
ret
diff --git a/engine/learn.asm b/engine/learn.asm
index 54ec8f6bb..fb62289a7 100755
--- a/engine/learn.asm
+++ b/engine/learn.asm
@@ -145,7 +145,7 @@ ForgetMove: ; 65d3
ld a, SCREEN_WIDTH * 2
ld [wBuffer1], a
predef ListMoves
- ; wMenuData3
+ ; w2DMenuData
ld a, $4
ld [w2DMenuCursorInitY], a
ld a, $6
diff --git a/engine/link.asm b/engine/link.asm
index 59d1a149a..856a23068 100755
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -35,7 +35,7 @@ LinkCommunications: ; 28000
cp LINK_TIMECAPSULE
jp nz, Gen2ToGen2LinkComms
-TimeCapsule: ; 2805d
+Gen2ToGen1LinkComms: ; 2805d
call ClearLinkData
call Link_PrepPartyData_Gen1
call FixDataForLinkTransfer
@@ -1670,7 +1670,7 @@ LinkTrade: ; 28b87
ld hl, UnknownText_0x28eb8
bccoord 1, 14
call PlaceHLTextAtBC
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
hlcoord 10, 7
ld b, 3
ld c, 7
@@ -1970,7 +1970,7 @@ LinkTrade: ; 28b87
call DelayFrames
ld a, [wLinkMode]
cp LINK_TIMECAPSULE
- jp z, TimeCapsule
+ jp z, Gen2ToGen1LinkComms
jp Gen2ToGen2LinkComms
; 28ea3
@@ -2031,14 +2031,15 @@ Unreferenced_Function28f09: ; 28f09
INCLUDE "engine/trade_animation.asm"
-Special_CheckTimeCapsuleCompatibility: ; 29bfb
-; Checks to see if your Party is compatible with the generation 1 games. Returns the following in wScriptVar:
+CheckTimeCapsuleCompatibility: ; 29bfb
+; Checks to see if your party is compatible with the Gen 1 games.
+; Returns the following in wScriptVar:
; 0: Party is okay
-; 1: At least one Pokemon was introduced in GS
-; 2: At least one Pokemon has a move that was introduced in GS
-; 3: At least one Pokemon is holding mail
+; 1: At least one Pokémon was introduced in Gen 2
+; 2: At least one Pokémon has a move that was introduced in Gen 2
+; 3: At least one Pokémon is holding mail
-; If any party Pokemon was introduced in the generation 2 games, don't let it in.
+; If any party Pokémon was introduced in the Gen 2 games, don't let it in.
ld hl, wPartySpecies
ld b, PARTY_LENGTH
.loop
@@ -2050,7 +2051,7 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb
dec b
jr nz, .loop
-; If any party Pokemon is holding mail, don't let it in.
+; If any party Pokémon is holding mail, don't let it in.
.checkitem
ld a, [wPartyCount]
ld b, a
@@ -2068,7 +2069,7 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb
dec b
jr nz, .itemloop
-; If any party Pokemon has a move that was introduced in the generation 2 games, don't let it in.
+; If any party Pokémon has a move that was introduced in the Gen 2 games, don't let it in.
ld hl, wPartyMon1Moves
ld a, [wPartyCount]
ld b, a
@@ -2126,7 +2127,7 @@ Function29c67: ; 29c67
ret
; 29c7b
-Special_EnterTimeCapsule: ; 29c7b
+EnterTimeCapsule: ; 29c7b
ld c, 10
call DelayFrames
ld a, $4
@@ -2140,7 +2141,7 @@ Special_EnterTimeCapsule: ; 29c7b
ret
; 29c92
-Special_WaitForOtherPlayerToExit: ; 29c92
+WaitForOtherPlayerToExit: ; 29c92
ld c, 3
call DelayFrames
ld a, CONNECTION_NOT_ESTABLISHED
@@ -2188,21 +2189,21 @@ Special_WaitForOtherPlayerToExit: ; 29c92
ret
; 29ce8
-Special_SetBitsForLinkTradeRequest: ; 29ce8
+SetBitsForLinkTradeRequest: ; 29ce8
ld a, LINK_TRADECENTER - 1
ld [wPlayerLinkAction], a
ld [wd265], a
ret
; 29cf1
-Special_SetBitsForBattleRequest: ; 29cf1
+SetBitsForBattleRequest: ; 29cf1
ld a, LINK_COLOSSEUM - 1
ld [wPlayerLinkAction], a
ld [wd265], a
ret
; 29cfa
-Special_SetBitsForTimeCapsuleRequest: ; 29cfa
+SetBitsForTimeCapsuleRequest: ; 29cfa
ld a, $2
ld [rSB], a
xor a
@@ -2217,7 +2218,7 @@ Special_SetBitsForTimeCapsuleRequest: ; 29cfa
ret
; 29d11
-Special_WaitForLinkedFriend: ; 29d11
+WaitForLinkedFriend: ; 29d11
ld a, [wPlayerLinkAction]
and a
jr z, .no_link_action
@@ -2289,7 +2290,7 @@ Special_WaitForLinkedFriend: ; 29d11
ret
; 29d92
-Special_CheckLinkTimeout: ; 29d92
+CheckLinkTimeout: ; 29d92
ld a, $1
ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames
@@ -2427,7 +2428,7 @@ Link_CheckCommunicationError: ; 29e0c
ret
; 29e66
-Special_TryQuickSave: ; 29e66
+TryQuickSave: ; 29e66
ld a, [wd265]
push af
farcall Link_SaveGame
@@ -2443,7 +2444,7 @@ Special_TryQuickSave: ; 29e66
ret
; 29e82
-Special_CheckBothSelectedSameRoom: ; 29e82
+CheckBothSelectedSameRoom: ; 29e82
ld a, [wd265]
call Link_EnsureSync
push af
@@ -2470,7 +2471,7 @@ Special_CheckBothSelectedSameRoom: ; 29e82
ret
; 29eaf
-Special_TimeCapsule: ; 29eaf
+TimeCapsule: ; 29eaf
ld a, LINK_TIMECAPSULE
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2481,7 +2482,7 @@ Special_TimeCapsule: ; 29eaf
ret
; 29ec4
-Special_TradeCenter: ; 29ec4
+TradeCenter: ; 29ec4
ld a, LINK_TRADECENTER
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2492,7 +2493,7 @@ Special_TradeCenter: ; 29ec4
ret
; 29ed9
-Special_Colosseum: ; 29ed9
+Colosseum: ; 29ed9
ld a, LINK_COLOSSEUM
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2503,7 +2504,7 @@ Special_Colosseum: ; 29ed9
ret
; 29eee
-Special_CloseLink: ; 29eee
+CloseLink: ; 29eee
xor a
ld [wLinkMode], a
ld c, 3
@@ -2511,7 +2512,7 @@ Special_CloseLink: ; 29eee
jp Link_ResetSerialRegistersAfterLinkClosure
; 29efa
-Special_FailedLinkToPast: ; 29efa
+FailedLinkToPast: ; 29efa
ld c, 40
call DelayFrames
ld a, $e
@@ -2560,7 +2561,7 @@ Link_EnsureSync: ; 29f17
ret
; 29f47
-Special_CableClubCheckWhichChris: ; 29f47
+CableClubCheckWhichChris: ; 29f47
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ld a, TRUE
diff --git a/engine/link_trade.asm b/engine/link_trade.asm
index bb3423051..90b242e90 100755
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -19,7 +19,7 @@ Function16d42e: ; 16d42e
; 16d43b
Function16d43b: ; 16d43b
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearBGPalettes
call ClearTileMap
call ClearSprites
@@ -169,7 +169,7 @@ LinkTextbox: ; 16d6ca
; 16d6ce
Function16d6ce: ; 16d6ce
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call Function16d6e1
farcall WaitLinkTransfer
call Call_ExitMenu
diff --git a/engine/mail.asm b/engine/mail.asm
index c1a2db5aa..f03a64bd4 100755
--- a/engine/mail.asm
+++ b/engine/mail.asm
@@ -310,10 +310,10 @@ IsAnyMonHoldingMail: ; 44781
ret
; 447a0
-_KrisMailBoxMenu: ; 0x447a0
+_PlayerMailBoxMenu: ; 0x447a0
call InitMail
jr z, .nomail
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call MailboxPC
jp CloseWindow
@@ -388,8 +388,8 @@ MailboxPC: ; 0x44806
ld [wCurMessageIndex], a
.loop
call InitMail
- ld hl, .TopMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, .TopMenuHeader
+ call CopyMenuHeader
xor a
ld [hBGMapMode], a
call InitScrollingMenu
@@ -417,8 +417,8 @@ MailboxPC: ; 0x44806
; 0x4484a
.Submenu: ; 0x4484a
- ld hl, .SubMenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .SubMenuHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
jr c, .subexit
@@ -557,13 +557,13 @@ MailboxPC: ; 0x44806
.Cancel:
ret
-.TopMenuDataHeader: ; 0x4494c
+.TopMenuHeader: ; 0x4494c
db MENU_BACKUP_TILES ; flags
menu_coords 8, 1, SCREEN_WIDTH - 2, 10
- dw .TopMenuData2
+ dw .TopMenuData
db 1 ; default option
-.TopMenuData2:
+.TopMenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows/columns?
db 1 ; horizontal spacing?
@@ -572,13 +572,13 @@ MailboxPC: ; 0x44806
dba NULL
dba NULL
-.SubMenuDataHeader: ; 0x44964
+.SubMenuHeader: ; 0x44964
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 13, 9
- dw .SubMenuData2
+ dw .SubMenuData
db 1 ; default option
-.SubMenuData2:
+.SubMenuData:
db STATICMENU_CURSOR ; flags
db 4 ; items
db "READ MAIL@"
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index 9d3d8cbdb..b4a5d1919 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -10,12 +10,12 @@ MainMenu: ; 49cdc
call GetSGBLayout
call SetPalettes
ld hl, wGameTimerPause
- res 0, [hl]
+ res GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a
call MainMenu_PrintCurrentTimeAndDay
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call MainMenuJoypadLoop
call CloseWindow
jr c, .quit
@@ -29,14 +29,14 @@ MainMenu: ; 49cdc
ret
; 49d14
-.MenuDataHeader: ; 49d14
+.MenuHeader: ; 49d14
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 16, 7
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 49d1c
-.MenuData2: ; 49d1c
+.MenuData: ; 49d1c
db STATICMENU_CURSOR ; flags
db 0 ; items
dw MainMenuItems
@@ -166,8 +166,9 @@ MainMenu_GetWhichMenu: ; 49da4
cp -1
call CloseSRAM
jr nz, .mystery_gift
+ ; This check makes no difference.
ld a, [wStatusFlags]
- bit 7, a
+ bit STATUSFLAGS_BUG_CONTEST_ON_F, a
ld a, $1 ; Continue
jr z, .ok
jr .ok
@@ -180,8 +181,9 @@ MainMenu_GetWhichMenu: ; 49da4
ret
.mystery_gift
+ ; This check makes no difference.
ld a, [wStatusFlags]
- bit 7, a
+ bit STATUSFLAGS_BUG_CONTEST_ON_F, a
jr z, .ok3
jr .ok3
diff --git a/engine/map_objects.asm b/engine/map_objects.asm
index b3efc5fb7..78d9062ef 100644
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -233,7 +233,7 @@ Function462a: ; 462a
UpdateTallGrassFlags: ; 463f
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 3, [hl] ; is current tile grass?
+ bit OVERHEAD, [hl]
jr z, .ok
ld hl, OBJECT_NEXT_TILE
add hl, bc
@@ -260,13 +260,13 @@ SetTallGrassFlags: ; 4661
.set
ld hl, OBJECT_FLAGS2
add hl, bc
- set 3, [hl]
+ set OVERHEAD, [hl]
ret
.reset
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD, [hl]
ret
; 4679
@@ -792,7 +792,7 @@ MapObjectMovementPattern: ; 47dd
ld [hl], STANDING
ld hl, OBJECT_ACTION
add hl, bc
- ld [hl], OBJECT_ACTION_BIG_SNORLAX
+ ld [hl], OBJECT_ACTION_BIG_DOLL_SYM
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_04
@@ -1103,20 +1103,20 @@ SetRandomStepDuration: ; 4b2d
StepTypesJumptable: ; 4b45
; entries correspond to STEP_TYPE_* constants
dw ObjectMovementReset ; 00
- dw MapObjectMovementPattern ; unused
- dw NPCStep ; 02 npc walk
+ dw MapObjectMovementPattern ; 01
+ dw NPCStep ; 02
dw StepType03 ; 03
dw StepType04 ; 04
dw StepType05 ; 05
- dw PlayerStep ; 06 player walk
+ dw PlayerStep ; 06
dw StepType07 ; 07
- dw NPCJump ; 08 npc jump step
- dw PlayerJump ; 09 player jump step
- dw PlayerOrNPCTurnStep ; 0a half step
+ dw NPCJump ; 08
+ dw PlayerJump ; 09
+ dw PlayerOrNPCTurnStep ; 0a
dw StepTypeBump ; 0b
- dw TeleportFrom ; 0c teleport from
- dw TeleportTo ; 0d teleport to
- dw Skyfall ; 0e skyfall
+ dw TeleportFrom ; 0c
+ dw TeleportTo ; 0d
+ dw Skyfall ; 0e
dw StepType0f ; 0f
dw GotBiteStep ; 10
dw RockSmashStep ; 11
@@ -2543,7 +2543,7 @@ RefreshPlayerSprite: ; 579d
.TryResetPlayerAction: ; 57bc
ld hl, wPlayerSpriteSetupFlags
- bit 7, [hl]
+ bit PLAYERSPRITESETUP_RESET_ACTION_F, [hl]
jr nz, .ok
ret
@@ -2555,10 +2555,10 @@ RefreshPlayerSprite: ; 579d
.SpawnInCustomFacing: ; 57ca
ld hl, wPlayerSpriteSetupFlags
- bit 5, [hl]
+ bit PLAYERSPRITESETUP_CUSTOM_FACING_F, [hl]
ret z
ld a, [wPlayerSpriteSetupFlags]
- and 3
+ and PLAYERSPRITESETUP_FACING_MASK
add a
add a
jr ContinueSpawnFacing
@@ -2572,7 +2572,7 @@ ContinueSpawnFacing: ; 57db
ret
; 57e2
-SetPlayerPalette: ; 57e2
+_SetPlayerPalette: ; 57e2
ld a, d
and %10000000
ret z
@@ -2918,10 +2918,10 @@ InitSprites: ; 5991
ld e, PRIORITY_LOW
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 0, [hl]
+ bit LOW_PRIORITY, [hl]
jr nz, .add
ld e, PRIORITY_NORM
- bit 1, [hl]
+ bit HIGH_PRIORITY, [hl]
jr z, .add
ld e, PRIORITY_HIGH
jr .add
diff --git a/engine/map_setup.asm b/engine/map_setup.asm
index 1cd660f86..268574de0 100644
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -79,7 +79,7 @@ MapSetupCommands: ; 15440
dba LoadGraphics ; 0e
dba LoadTileset ; 0f
dba LoadMapTimeOfDay ; 10
- dba Special_LoadMapPalettes ; 11
+ dba LoadMapPalettes ; 11
dba LoadWildMonData ; 12
dba RefreshMapSprites ; 13
dba HandleNewMap ; 14
@@ -91,8 +91,8 @@ MapSetupCommands: ; 15440
dba LoadMapAttributes ; 1a
dba LoadMapAttributes_SkipPeople ; 1b
dba ClearBGPalettes ; 1c
- dba Special_FadeOutPalettes ; 1d
- dba Special_FadeInPalettes ; 1e
+ dba FadeOutPalettes ; 1d
+ dba FadeInPalettes ; 1e
dba GetCoordOfUpperLeftCorner ; 1f
dba RestoreFacingAfterWarp ; 20
dba SpawnInFacingDown ; 21
@@ -143,13 +143,13 @@ LoadObjectsRunCallback_02: ; 154d7
DelayClearingOldSprites: ; 154eb
ld hl, wPlayerSpriteSetupFlags
- set 7, [hl]
+ set PLAYERSPRITESETUP_RESET_ACTION_F, [hl]
ret
; 154f1
DelayLoadingNewSprites: ; 154f1
ld hl, wPlayerSpriteSetupFlags
- set 6, [hl]
+ set PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
ret
CheckReplaceKrisSprite: ; 154f7
@@ -169,7 +169,7 @@ CheckReplaceKrisSprite: ; 154f7
.CheckBiking: ; 1550c (5:550c)
and a
ld hl, wBikeFlags
- bit 1, [hl]
+ bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
ret z
ld a, PLAYER_BIKE
ld [wPlayerState], a
diff --git a/engine/mart.asm b/engine/mart.asm
index 84888eccc..911251f65 100755
--- a/engine/mart.asm
+++ b/engine/mart.asm
@@ -36,7 +36,7 @@ MartDialog: ; 15a61
HerbShop: ; 15a6e
call FarReadMart
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_HerbShop_Intro
call MartTextBox
call BuyMenu
@@ -50,7 +50,7 @@ BargainShop: ; 15a84
ld de, BargainShopData
call LoadMartPointer
call ReadMart
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_BargainShop_Intro
call MartTextBox
call BuyMenu
@@ -59,7 +59,7 @@ BargainShop: ; 15a84
or [hl]
jr z, .skip_set
ld hl, wDailyFlags
- set 6, [hl]
+ set DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F, [hl]
.skip_set
ld hl, Text_BargainShop_ComeAgain
@@ -69,7 +69,7 @@ BargainShop: ; 15a84
Pharmacist: ; 15aae
call FarReadMart
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_Pharmacist_Intro
call MartTextBox
call BuyMenu
@@ -79,18 +79,18 @@ Pharmacist: ; 15aae
; 15ac4
RooftopSale: ; 15ac4
- ld b, BANK(RooftopSaleData1)
- ld de, RooftopSaleData1
+ ld b, BANK(RooftopSaleMart1)
+ ld de, RooftopSaleMart1
ld hl, wStatusFlags
- bit 6, [hl] ; hall of fame
+ bit STATUSFLAGS_HALL_OF_FAME_F, [hl]
jr z, .ok
- ld b, BANK(RooftopSaleData2)
- ld de, RooftopSaleData2
+ ld b, BANK(RooftopSaleMart2)
+ ld de, RooftopSaleMart2
.ok
call LoadMartPointer
call ReadMart
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_Mart_HowMayIHelpYou
call MartTextBox
call BuyMenu
@@ -121,7 +121,7 @@ LoadMartPointer: ; 15b10
GetMart: ; 15b31
ld a, e
- cp (MartsEnd - Marts) / 2
+ cp (Marts.End - Marts) / 2
jr c, .IsAMart
ld b, BANK(DefaultMart)
ld de, DefaultMart
@@ -158,7 +158,7 @@ StandardMart: ; 15b47
; 15b62
.HowMayIHelpYou: ; 15b62
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_Mart_HowMayIHelpYou
call PrintText
ld a, $1 ; top menu
@@ -166,8 +166,8 @@ StandardMart: ; 15b47
; 15b6e
.TopMenu: ; 15b6e
- ld hl, MenuDataHeader_BuySell
- call CopyMenuDataHeader
+ ld hl, MenuHeader_BuySell
+ call CopyMenuHeader
call VerticalMenu
jr c, .quit
ld a, [wMenuCursorY]
@@ -211,7 +211,7 @@ StandardMart: ; 15b47
; 15baf
.AnythingElse: ; 15baf
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, Text_Mart_AnythingElse
call PrintText
ld a, $1 ; top menu
@@ -443,10 +443,10 @@ GetMartDialogGroup: ; 15ca3
BuyMenuLoop: ; 15cef
- farcall Special_PlaceMoneyTopRight
+ farcall PlaceMoneyTopRight
call UpdateSprites
- ld hl, MenuDataHeader_Buy
- call CopyMenuDataHeader
+ ld hl, MenuHeader_Buy
+ call CopyMenuHeader
ld a, [wMenuCursorBufferBackup]
ld [wMenuCursorBuffer], a
ld a, [wMenuScrollPositionBackup]
@@ -616,14 +616,14 @@ Text_Mart_CostsThisMuch: ; 0x15e13
db "@"
; 0x15e18
-MenuDataHeader_Buy: ; 0x15e18
+MenuHeader_Buy: ; 0x15e18
db MENU_BACKUP_TILES ; flags
menu_coords 1, 3, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .menudata2
+ dw .MenuData
db 1 ; default option
; 0x15e20
-.menudata2 ; 0x15e20
+.MenuData ; 0x15e20
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
db 4, 8 ; rows, columns
db 1 ; horizontal spacing
@@ -900,14 +900,14 @@ Text_Mart_HowMayIHelpYou: ; 0x15f83
db "@"
; 0x15f88
-MenuDataHeader_BuySell: ; 0x15f88
+MenuHeader_BuySell: ; 0x15f88
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 7, 8
- dw .menudata2
+ dw .MenuData
db 1 ; default option
; 0x15f90
-.menudata2 ; 0x15f90
+.MenuData ; 0x15f90
db STATICMENU_CURSOR ; strings
db 3 ; items
db "BUY@"
diff --git a/engine/menu.asm b/engine/menu.asm
index 846ad0ad9..51de2e1a4 100755
--- a/engine/menu.asm
+++ b/engine/menu.asm
@@ -1,6 +1,6 @@
_2DMenu_:: ; 2400e
- ld hl, CopyMenuData2
- ld a, [wMenuData2_2DMenuItemStringsBank]
+ ld hl, CopyMenuData
+ ld a, [wMenuData_2DMenuItemStringsBank]
rst FarCall
call Draw2DMenu
@@ -11,8 +11,8 @@ _2DMenu_:: ; 2400e
; 24022
_InterpretBattleMenu:: ; 24022
- ld hl, CopyMenuData2
- ld a, [wMenuData2_2DMenuItemStringsBank]
+ ld hl, CopyMenuData
+ ld a, [wMenuData_2DMenuItemStringsBank]
rst FarCall
call Draw2DMenu
@@ -24,8 +24,8 @@ _InterpretBattleMenu:: ; 24022
; 2403c
_InterpretMobileMenu:: ; 2403c
- ld hl, CopyMenuData2
- ld a, [wMenuData2_2DMenuItemStringsBank]
+ ld hl, CopyMenuData
+ ld a, [wMenuData_2DMenuItemStringsBank]
rst FarCall
call Draw2DMenu
@@ -73,7 +73,7 @@ Get2DMenuSelection: ; 2408f
call StaticMenuJoypad
call MenuClickSound
Mobile_GetMenuSelection: ; 24098
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 1, a
jr z, .skip
call GetMenuJoypad
@@ -81,7 +81,7 @@ Mobile_GetMenuSelection: ; 24098
jr nz, .quit1
.skip
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 0, a
jr nz, .skip2
call GetMenuJoypad
@@ -111,20 +111,20 @@ Mobile_GetMenuSelection: ; 24098
; 240cd
Get2DMenuNumberOfColumns: ; 240cd
- ld a, [wMenuData2_2DMenuDimensions]
+ ld a, [wMenuData_2DMenuDimensions]
and $f
ret
; 240d3
Get2DMenuNumberOfRows: ; 240d3
- ld a, [wMenuData2_2DMenuDimensions]
+ ld a, [wMenuData_2DMenuDimensions]
swap a
and $f
ret
; 240db
Place2DMenuItemStrings: ; 240db
- ld hl, wMenuData2_2DMenuItemStringsAddr
+ ld hl, wMenuData_2DMenuItemStringsAddr
ld e, [hl]
inc hl
ld d, [hl]
@@ -139,10 +139,10 @@ Place2DMenuItemStrings: ; 240db
ld c, a
.col
push bc
- ld a, [wMenuData2_2DMenuItemStringsBank]
+ ld a, [wMenuData_2DMenuItemStringsBank]
call Place2DMenuItemName
inc de
- ld a, [wMenuData2_2DMenuSpacing]
+ ld a, [wMenuData_2DMenuSpacing]
ld c, a
ld b, 0
add hl, bc
@@ -155,13 +155,13 @@ Place2DMenuItemStrings: ; 240db
pop bc
dec b
jr nz, .row
- ld hl, wMenuData2_2DMenuFunctionAddr
+ ld hl, wMenuData_2DMenuFunctionAddr
ld a, [hli]
ld h, [hl]
ld l, a
or h
ret z
- ld a, [wMenuData2_2DMenuFunctionBank]
+ ld a, [wMenuData_2DMenuFunctionBank]
rst FarCall
ret
; 2411a
@@ -229,7 +229,7 @@ Init2DMenuCursorPosition: ; 2411a (9:411a)
ld hl, w2DMenuFlags1
ld [hli], a
ld [hld], a
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 5, a
ret z
set 5, [hl]
@@ -238,14 +238,14 @@ Init2DMenuCursorPosition: ; 2411a (9:411a)
; 2418a
.InitFlags_b: ; 2418a
- ld a, [wMenuData2_2DMenuSpacing]
+ ld a, [wMenuData_2DMenuSpacing]
or $20
ld [w2DMenuCursorOffsets], a
ret
; 24193
.InitFlags_c: ; 24193
- ld hl, wMenuData2Flags
+ ld hl, wMenuDataFlags
ld a, A_BUTTON
bit 0, [hl]
jr nz, .skip
@@ -771,7 +771,7 @@ Error_Cant_ExitMenu: ; 2445d
; 2446d
_InitVerticalMenuCursor:: ; 2446d
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
ld b, a
ld hl, w2DMenuCursorInitY
ld a, [wMenuBorderTopCoord]
@@ -786,7 +786,7 @@ _InitVerticalMenuCursor:: ; 2446d
inc a
ld [hli], a
; w2DMenuNumRows
- ld a, [wMenuData2Items]
+ ld a, [wMenuDataItems]
ld [hli], a
; w2DMenuNumCols
ld a, 1
@@ -821,7 +821,7 @@ _InitVerticalMenuCursor:: ; 2446d
and a
jr z, .load_at_the_top
ld c, a
- ld a, [wMenuData2Items]
+ ld a, [wMenuDataItems]
cp c
jr nc, .load_position
.load_at_the_top
diff --git a/engine/menu_2.asm b/engine/menu_2.asm
index 44960783f..16cce5348 100644
--- a/engine/menu_2.asm
+++ b/engine/menu_2.asm
@@ -27,22 +27,22 @@ PlaceMenuItemQuantity: ; 0x24ac3
.done
ret
-Special_PlaceMoneyTopRight: ; 24ae8
- ld hl, MenuDataHeader_0x24b15
- call CopyMenuDataHeader
- jr PlaceMoneyDataHeader
+PlaceMoneyTopRight: ; 24ae8
+ ld hl, MenuHeader_0x24b15
+ call CopyMenuHeader
+ jr PlaceMoneyTextBox
PlaceMoneyBottomLeft: ; 24af0
- ld hl, MenuDataHeader_0x24b1d
- call CopyMenuDataHeader
- jr PlaceMoneyDataHeader
+ ld hl, MenuHeader_0x24b1d
+ call CopyMenuHeader
+ jr PlaceMoneyTextBox
PlaceMoneyAtTopLeftOfTextbox: ; 24af8
- ld hl, MenuDataHeader_0x24b15
+ ld hl, MenuHeader_0x24b15
lb de, 0, 11
- call OffsetMenuDataHeader
+ call OffsetMenuHeader
-PlaceMoneyDataHeader: ; 24b01
+PlaceMoneyTextBox: ; 24b01
call MenuBox
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
@@ -52,19 +52,19 @@ PlaceMoneyDataHeader: ; 24b01
call PrintNum
ret
-MenuDataHeader_0x24b15: ; 0x24b15
+MenuHeader_0x24b15: ; 0x24b15
db MENU_BACKUP_TILES ; flags
menu_coords 11, 0, SCREEN_WIDTH - 1, 2
dw NULL
db 1 ; default option
-MenuDataHeader_0x24b1d: ; 0x24b1d
+MenuHeader_0x24b1d: ; 0x24b1d
db MENU_BACKUP_TILES ; flags
menu_coords 0, 11, 8, 13
dw NULL
db 1 ; default option
-Special_DisplayCoinCaseBalance: ; 24b25
+DisplayCoinCaseBalance: ; 24b25
; Place a text box of size 1x7 at 11, 0.
hlcoord 11, 0
ld b, 1
@@ -82,7 +82,7 @@ Special_DisplayCoinCaseBalance: ; 24b25
call PrintNum
ret
-Special_DisplayMoneyAndCoinBalance: ; 24b4e
+DisplayMoneyAndCoinBalance: ; 24b4e
hlcoord 5, 0
ld b, 3
ld c, 13
diff --git a/engine/mon_menu.asm b/engine/mon_menu.asm
index f398910ac..088b1b1a3 100755
--- a/engine/mon_menu.asm
+++ b/engine/mon_menu.asm
@@ -1,47 +1,12 @@
-MonMenuOptionStrings: ; 24caf
- db "STATS@"
- db "SWITCH@"
- db "ITEM@"
- db "CANCEL@"
- db "MOVE@"
- db "MAIL@"
- db "ERROR!@"
-; 24cd9
-
-MonMenuOptions: ; 24cd9
-; moves
- db MONMENU_FIELD_MOVE, MONMENU_CUT, CUT
- db MONMENU_FIELD_MOVE, MONMENU_FLY, FLY
- db MONMENU_FIELD_MOVE, MONMENU_SURF, SURF
- db MONMENU_FIELD_MOVE, MONMENU_STRENGTH, STRENGTH
- db MONMENU_FIELD_MOVE, MONMENU_FLASH, FLASH
- db MONMENU_FIELD_MOVE, MONMENU_WATERFALL, WATERFALL
- db MONMENU_FIELD_MOVE, MONMENU_WHIRLPOOL, WHIRLPOOL
- db MONMENU_FIELD_MOVE, MONMENU_DIG, DIG
- db MONMENU_FIELD_MOVE, MONMENU_TELEPORT, TELEPORT
- db MONMENU_FIELD_MOVE, MONMENU_SOFTBOILED, SOFTBOILED
- db MONMENU_FIELD_MOVE, MONMENU_HEADBUTT, HEADBUTT
- db MONMENU_FIELD_MOVE, MONMENU_ROCKSMASH, ROCK_SMASH
- db MONMENU_FIELD_MOVE, MONMENU_MILKDRINK, MILK_DRINK
- db MONMENU_FIELD_MOVE, MONMENU_SWEETSCENT, SWEET_SCENT
-; options
- db MONMENU_MENUOPTION, MONMENU_STATS, 1 ; STATS
- db MONMENU_MENUOPTION, MONMENU_SWITCH, 2 ; SWITCH
- db MONMENU_MENUOPTION, MONMENU_ITEM, 3 ; ITEM
- db MONMENU_MENUOPTION, MONMENU_CANCEL, 4 ; CANCEL
- db MONMENU_MENUOPTION, MONMENU_MOVE, 5 ; MOVE
- db MONMENU_MENUOPTION, MONMENU_MAIL, 6 ; MAIL
- db MONMENU_MENUOPTION, MONMENU_ERROR, 7 ; ERROR!
- db -1
-; 24d19
+INCLUDE "data/mon_menu.asm"
MonSubmenu: ; 24d19
xor a
ld [hBGMapMode], a
call GetMonSubmenuItems
farcall FreezeMonIcons
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call .GetTopCoord
call PopulateMonMenu
@@ -54,7 +19,7 @@ MonSubmenu: ; 24d19
ret
; 24d3f
-.MenuDataHeader: ; 24d3f
+.MenuHeader: ; 24d3f
db MENU_BACKUP_TILES ; flags
menu_coords 6, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw 0
@@ -78,9 +43,9 @@ MonSubmenu: ; 24d19
MonMenuLoop: ; 24d59
.loop
ld a, MENU_UNUSED_3 | MENU_BACKUP_TILES_2 ; flags
- ld [wMenuData2Flags], a
+ ld [wMenuDataFlags], a
ld a, [wBuffer1] ; items
- ld [wMenuData2Items], a
+ ld [wMenuDataItems], a
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
set 6, [hl]
@@ -95,7 +60,7 @@ MonMenuLoop: ; 24d59
jr .loop
.cancel
- ld a, MONMENU_CANCEL ; CANCEL
+ ld a, MONMENUITEM_CANCEL
ret
.select
@@ -111,7 +76,7 @@ MonMenuLoop: ; 24d59
PopulateMonMenu: ; 24d91
call MenuBoxCoord2Tile
- ld bc, $2a ; 42
+ ld bc, 2 * SCREEN_WIDTH + 2
add hl, bc
ld de, wBuffer2
.loop
@@ -124,7 +89,7 @@ PopulateMonMenu: ; 24d91
call GetMonMenuString
pop hl
call PlaceString
- ld bc, $28 ; 40
+ ld bc, 2 * SCREEN_WIDTH
add hl, bc
pop de
jr .loop
@@ -136,7 +101,7 @@ GetMonMenuString: ; 24db0
call IsInArray
dec hl
ld a, [hli]
- cp 1
+ cp MONMENU_MENUOPTION
jr z, .NotMove
inc hl
ld a, [hl]
@@ -188,11 +153,11 @@ GetMonSubmenuItems: ; 24dd4
jr nz, .loop
.skip_moves
- ld a, MONMENU_STATS
+ ld a, MONMENUITEM_STATS
call AddMonMenuItem
- ld a, MONMENU_SWITCH
+ ld a, MONMENUITEM_SWITCH
call AddMonMenuItem
- ld a, MONMENU_MOVE
+ ld a, MONMENUITEM_MOVE
call AddMonMenuItem
ld a, [wLinkMode]
and a
@@ -203,9 +168,9 @@ GetMonSubmenuItems: ; 24dd4
ld d, [hl]
farcall ItemIsMail
pop hl
- ld a, MONMENU_MAIL
+ ld a, MONMENUITEM_MAIL
jr c, .ok
- ld a, MONMENU_ITEM
+ ld a, MONMENUITEM_ITEM
.ok
call AddMonMenuItem
@@ -214,7 +179,7 @@ GetMonSubmenuItems: ; 24dd4
ld a, [wBuffer1]
cp NUM_MONMENU_ITEMS
jr z, .ok2
- ld a, MONMENU_CANCEL
+ ld a, MONMENUITEM_CANCEL
call AddMonMenuItem
.ok2
@@ -222,11 +187,11 @@ GetMonSubmenuItems: ; 24dd4
ret
.egg
- ld a, MONMENU_STATS
+ ld a, MONMENUITEM_STATS
call AddMonMenuItem
- ld a, MONMENU_SWITCH
+ ld a, MONMENUITEM_SWITCH
call AddMonMenuItem
- ld a, MONMENU_CANCEL
+ ld a, MONMENUITEM_CANCEL
call AddMonMenuItem
call TerminateMonSubmenu
ret
@@ -265,7 +230,7 @@ ResetMonSubmenu: ; 24e68
TerminateMonSubmenu: ; 24e76
ld a, [wBuffer1]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, wBuffer2
add hl, de
ld [hl], -1
@@ -280,7 +245,7 @@ AddMonMenuItem: ; 24e83
ld e, a
inc a
ld [wBuffer1], a
- ld d, $0
+ ld d, 0
ld hl, wBuffer2
add hl, de
pop af
@@ -291,16 +256,16 @@ AddMonMenuItem: ; 24e83
; 24e99
BattleMonMenu: ; 24e99
- ld hl, MenuDataHeader_0x24ed4
- call CopyMenuDataHeader
+ ld hl, MenuHeader_0x24ed4
+ call CopyMenuHeader
xor a
ld [hBGMapMode], a
call MenuBox
call UpdateSprites
call PlaceVerticalMenuItems
call WaitBGMap
- call CopyMenuData2
- ld a, [wMenuData2Flags]
+ call CopyMenuData
+ ld a, [wMenuDataFlags]
bit 7, a
jr z, .set_carry
call InitVerticalMenuCursor
@@ -323,14 +288,14 @@ BattleMonMenu: ; 24e99
ret
; 24ed4
-MenuDataHeader_0x24ed4: ; 24ed4
+MenuHeader_0x24ed4: ; 24ed4
db 0 ; flags
menu_coords 11, 11, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw MenuData2_0x24edc
+ dw MenuData_0x24edc
db 1 ; default option
; 24edc
-MenuData2_0x24edc: ; 24edc
+MenuData_0x24edc: ; 24edc
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 3 ; items
db "SWITCH@"
diff --git a/engine/mon_stats.asm b/engine/mon_stats.asm
index a06ad1a46..12f27bbc1 100644
--- a/engine/mon_stats.asm
+++ b/engine/mon_stats.asm
@@ -122,7 +122,7 @@ PrintTempMonStats: ; 50b7b
next "@"
GetGender: ; 50bdd
-; Return the gender of a given monster (wCurPartyMon/wCurOTMon/CurWildMon).
+; Return the gender of a given monster (wCurPartyMon/wCurOTMon/wCurWildMon).
; When calling this function, a should be set to an appropriate wMonType value.
; return values:
diff --git a/engine/move_mon.asm b/engine/move_mon.asm
index 0c0694851..e3a8bd768 100755
--- a/engine/move_mon.asm
+++ b/engine/move_mon.asm
@@ -1786,7 +1786,7 @@ TextJump_WasSentToBillsPC: ; 0xe3d9
InitNickname: ; e3de
push de
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call DisableSpriteUpdates
pop de
push de
diff --git a/engine/movement.asm b/engine/movement.asm
index a701ff6f9..3dbb0b83a 100644
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -838,7 +838,7 @@ JumpStep: ; 548a
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD, [hl]
ld hl, OBJECT_ACTION
add hl, bc
diff --git a/engine/mystery_gift.asm b/engine/mystery_gift.asm
index dc1daa1a3..62332da05 100755
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -1157,7 +1157,7 @@ MysteryGift_CopyReceivedDecosToPC: ; 105091 (41:5091)
jr c, .loop
jp CloseSRAM
-Special_UnlockMysteryGift: ; 1050b9
+UnlockMysteryGift: ; 1050b9
call GetMysteryGiftBank
ld hl, sMysteryGiftUnlocked
ld a, [hl]
@@ -1279,7 +1279,7 @@ InitMysteryGiftLayout: ; 105153 (41:5153)
ld hl, MysteryGiftGFX
ld de, vTiles2 tile $00
ld a, BANK(MysteryGiftGFX)
- ld bc, MysteryGiftGFXEnd - MysteryGiftGFX
+ ld bc, MysteryGiftGFX.End - MysteryGiftGFX
call FarCopyBytes
hlcoord 0, 0
ld a, $42
@@ -1412,7 +1412,7 @@ InitMysteryGiftLayout: ; 105153 (41:5153)
MysteryGiftGFX: ; 105258
INCBIN "gfx/mystery_gift/mystery_gift.2bpp"
-MysteryGiftGFXEnd:
+.End
Function105688: ; 105688 (41:5688)
call ClearTileMap
diff --git a/engine/mystery_gift_2.asm b/engine/mystery_gift_2.asm
index bb86e1ae6..e0e2e88fd 100755
--- a/engine/mystery_gift_2.asm
+++ b/engine/mystery_gift_2.asm
@@ -123,7 +123,7 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642)
MysteryGiftGetItemHeldEffect: ; 2c708 (b:4708)
ld a, c
- cp MysteryGiftItemsEnd - MysteryGiftItems
+ cp MysteryGiftItems.End - MysteryGiftItems
jr nc, MysteryGiftFallbackItem
ld hl, MysteryGiftItems
ld b, 0
@@ -133,7 +133,7 @@ MysteryGiftGetItemHeldEffect: ; 2c708 (b:4708)
MysteryGiftGetDecoration: ; 2c715 (b:4715)
ld a, c
- cp MysteryGiftDecosEnd - MysteryGiftDecos
+ cp MysteryGiftDecos.End - MysteryGiftDecos
jr nc, MysteryGiftFallbackItem
ld hl, MysteryGiftDecos
ld b, 0
diff --git a/engine/naming_screen.asm b/engine/naming_screen.asm
index 859e7a515..a958e10eb 100755
--- a/engine/naming_screen.asm
+++ b/engine/naming_screen.asm
@@ -771,7 +771,7 @@ NamingScreen_AdvanceCursor_CheckEndOfString: ; 11b27
; 11b56
-INCLUDE "data/unused/dakutens.asm"
+INCLUDE "data/text/unused_dakutens.asm"
; 11bbc
@@ -945,7 +945,7 @@ NamingScreenGFX_Cursor: ; 11cc7
INCBIN "gfx/naming_screen/cursor.2bpp"
; 11ce7
-INCLUDE "data/name_input_chars.asm"
+INCLUDE "data/text/name_input_chars.asm"
; 11e5d
NamingScreenGFX_End: ; unused
@@ -1462,6 +1462,6 @@ MailComposition_TryAddLastCharacter: ; 121ac (4:61ac)
; 121dd
-INCLUDE "data/mail_input_chars.asm"
+INCLUDE "data/text/mail_input_chars.asm"
; 122c1
diff --git a/engine/npc_movement.asm b/engine/npc_movement.asm
index ecb520554..5670935e8 100755
--- a/engine/npc_movement.asm
+++ b/engine/npc_movement.asm
@@ -496,7 +496,7 @@ Unreferenced_Function7113:
ld hl, OBJECT_MOVEMENTTYPE
add hl, bc
ld a, [hl]
- cp SPRITEMOVEDATA_SNORLAX
+ cp SPRITEMOVEDATA_BIGDOLLSYM
jr nz, .not_snorlax
call Function7171
jr c, .yes
diff --git a/engine/options_menu.asm b/engine/options_menu.asm
index b6ca978d1..c0a255cb0 100755
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -120,7 +120,7 @@ Options_TextSpeed: ; e42f5
ld a, c ; right pressed
cp OPT_TEXT_SPEED_SLOW
jr c, .Increase
- ld c, OPT_TEXT_SPEED_FAST +- 1
+ ld c, OPT_TEXT_SPEED_FAST + -1
.Increase:
inc c
diff --git a/engine/overworld.asm b/engine/overworld.asm
index 7e3a69c6f..be8fa44af 100755
--- a/engine/overworld.asm
+++ b/engine/overworld.asm
@@ -23,7 +23,7 @@ Function14146: ; mobile
push af
res 7, [hl]
set 6, [hl]
- call Special_LoadUsedSpritesGFX
+ call LoadUsedSpritesGFX
pop af
ld [wSpriteFlags], a
ret
@@ -35,15 +35,15 @@ Function14157: ; mobile
push af
set 7, [hl]
res 6, [hl]
- call Special_LoadUsedSpritesGFX
+ call LoadUsedSpritesGFX
pop af
ld [wSpriteFlags], a
ret
; 14168
-Special_RefreshSprites:: ; 14168
+RefreshSprites:: ; 14168
call .Refresh
- call Special_LoadUsedSpritesGFX
+ call LoadUsedSpritesGFX
ret
; 1416f
@@ -60,14 +60,14 @@ Special_RefreshSprites:: ; 14168
GetPlayerSprite: ; 14183
; Get Chris or Kris's sprite.
- ld hl, .Chris
+ ld hl, ChrisStateSprites
ld a, [wPlayerSpriteSetupFlags]
- bit 2, a
+ bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .go
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .go
- ld hl, .Kris
+ ld hl, KrisStateSprites
.go
ld a, [wPlayerState]
@@ -95,20 +95,7 @@ GetPlayerSprite: ; 14183
ld [wPlayerObjectSprite], a
ret
-.Chris:
- db PLAYER_NORMAL, SPRITE_CHRIS
- db PLAYER_BIKE, SPRITE_CHRIS_BIKE
- db PLAYER_SURF, SPRITE_SURF
- db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
- db -1 ; end
-
-.Kris:
- db PLAYER_NORMAL, SPRITE_KRIS
- db PLAYER_BIKE, SPRITE_KRIS_BIKE
- db PLAYER_SURF, SPRITE_SURF
- db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
- db -1 ; end
-; 141c9
+INCLUDE "data/sprites/player_sprites.asm"
AddMapSprites: ; 141c9
@@ -164,7 +151,7 @@ AddOutdoorSprites: ; 141ee
; 14209
-Special_LoadUsedSpritesGFX: ; 14209
+LoadUsedSpritesGFX: ; 14209
ld a, MAPCALLBACK_SPRITES
call RunMapCallback
call GetUsedSprites
diff --git a/engine/pack.asm b/engine/pack.asm
index dfe30612d..91a76ee32 100644
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -74,8 +74,8 @@ Pack: ; 10000
ret
.ItemsPocketMenu: ; 10067 (4:4067)
- ld hl, ItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, ItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
@@ -102,8 +102,8 @@ Pack: ; 10000
ret
.KeyItemsPocketMenu: ; 100a6 (4:40a6)
- ld hl, KeyItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, KeyItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
@@ -141,16 +141,16 @@ Pack: ; 10000
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .use_quit
- ld hl, .MenuDataHeader2
+ ld hl, .MenuHeader2
ld de, .Jumptable2
jr .load_jump
.use_quit
- ld hl, .MenuDataHeader1
+ ld hl, .MenuHeader1
ld de, .Jumptable1
.load_jump
push de
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
pop hl
@@ -161,14 +161,14 @@ Pack: ; 10000
jp hl
; 10124 (4:4124)
-.MenuDataHeader1: ; 0x10124
+.MenuHeader1: ; 0x10124
db MENU_BACKUP_TILES ; flags
menu_coords 13, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2_1
+ dw .MenuData_1
db 1 ; default option
; 0x1012c
-.MenuData2_1: ; 0x1012c
+.MenuData_1: ; 0x1012c
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 2 ; items
db "USE@"
@@ -181,14 +181,14 @@ Pack: ; 10000
; 1013b
-.MenuDataHeader2: ; 0x1013b
+.MenuHeader2: ; 0x1013b
db MENU_BACKUP_TILES ; flags
menu_coords 13, 5, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2_2
+ dw .MenuData_2
db 1 ; default option
; 0x10143
-.MenuData2_2: ; 0x10143
+.MenuData_2: ; 0x10143
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 3 ; items
db "USE@"
@@ -232,8 +232,8 @@ Pack: ; 10000
ret
.BallsPocketMenu: ; 10198 (4:4198)
- ld hl, BallsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, BallsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
@@ -280,36 +280,36 @@ Pack: ; 10000
jr .tossable_unselectable
.usable
- ld hl, MenuDataHeader_UsableKeyItem
+ ld hl, MenuHeader_UsableKeyItem
ld de, Jumptable_UseGiveTossRegisterQuit
jr .build_menu
.selectable_usable
- ld hl, MenuDataHeader_UsableItem
+ ld hl, MenuHeader_UsableItem
ld de, Jumptable_UseGiveTossQuit
jr .build_menu
.tossable_selectable
- ld hl, MenuDataHeader_UnusableItem
+ ld hl, MenuHeader_UnusableItem
ld de, Jumptable_UseQuit
jr .build_menu
.tossable_unselectable
- ld hl, MenuDataHeader_UnusableKeyItem
+ ld hl, MenuHeader_UnusableKeyItem
ld de, Jumptable_UseRegisterQuit
jr .build_menu
.unusable
- ld hl, MenuDataHeader_HoldableKeyItem
+ ld hl, MenuHeader_HoldableKeyItem
ld de, Jumptable_GiveTossRegisterQuit
jr .build_menu
.selectable_unusable
- ld hl, MenuDataHeader_HoldableItem
+ ld hl, MenuHeader_HoldableItem
ld de, Jumptable_GiveTossQuit
.build_menu
push de
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
pop hl
@@ -320,14 +320,14 @@ Pack: ; 10000
jp hl
; 10249 (4:4249)
-MenuDataHeader_UsableKeyItem: ; 0x10249
+MenuHeader_UsableKeyItem: ; 0x10249
db MENU_BACKUP_TILES ; flags
menu_coords 13, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10251
-.MenuData2: ; 0x10251
+.MenuData: ; 0x10251
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 5 ; items
db "USE@"
@@ -345,14 +345,14 @@ Jumptable_UseGiveTossRegisterQuit: ; 1026a
dw QuitItemSubmenu
; 10274
-MenuDataHeader_UsableItem: ; 0x10274
+MenuHeader_UsableItem: ; 0x10274
db MENU_BACKUP_TILES ; flags
menu_coords 13, 3, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x1027c
-.MenuData2: ; 0x1027c
+.MenuData: ; 0x1027c
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 4 ; items
db "USE@"
@@ -368,14 +368,14 @@ Jumptable_UseGiveTossQuit: ; 10291
dw QuitItemSubmenu
; 10299
-MenuDataHeader_UnusableItem: ; 0x10299
+MenuHeader_UnusableItem: ; 0x10299
db MENU_BACKUP_TILES ; flags
menu_coords 13, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x102a1
-.MenuData2: ; 0x102a1
+.MenuData: ; 0x102a1
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 2 ; items
db "USE@"
@@ -387,14 +387,14 @@ Jumptable_UseQuit: ; 102ac
dw QuitItemSubmenu
; 102b0
-MenuDataHeader_UnusableKeyItem: ; 0x102b0
+MenuHeader_UnusableKeyItem: ; 0x102b0
db MENU_BACKUP_TILES ; flags
menu_coords 13, 5, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x102b8
-.MenuData2: ; 0x102b8
+.MenuData: ; 0x102b8
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 3 ; items
db "USE@"
@@ -408,14 +408,14 @@ Jumptable_UseRegisterQuit: ; 102c7
dw QuitItemSubmenu
; 102cd
-MenuDataHeader_HoldableKeyItem: ; 0x102cd
+MenuHeader_HoldableKeyItem: ; 0x102cd
db MENU_BACKUP_TILES ; flags
menu_coords 13, 3, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x102d5
-.MenuData2: ; 0x102d5
+.MenuData: ; 0x102d5
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 4 ; items
db "GIVE@"
@@ -431,14 +431,14 @@ Jumptable_GiveTossRegisterQuit: ; 102ea
dw QuitItemSubmenu
; 102f2
-MenuDataHeader_HoldableItem: ; 0x102f2
+MenuHeader_HoldableItem: ; 0x102f2
db MENU_BACKUP_TILES ; flags
menu_coords 13, 5, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x102fa
-.MenuData2: ; 0x102fa
+.MenuData: ; 0x102fa
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 3 ; items
db "GIVE@"
@@ -724,8 +724,8 @@ BattlePack: ; 10493
ret
.ItemsPocketMenu: ; 104fa (4:44fa)
- ld hl, ItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, ItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
@@ -752,8 +752,8 @@ BattlePack: ; 10493
ret
.KeyItemsPocketMenu: ; 10539 (4:4539)
- ld hl, KeyItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, KeyItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
@@ -803,8 +803,8 @@ BattlePack: ; 10493
ret
.BallsPocketMenu: ; 105a6 (4:45a6)
- ld hl, BallsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, BallsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
@@ -827,16 +827,16 @@ ItemSubmenu: ; 105d3 (4:45d3)
TMHMSubmenu: ; 105dc (4:45dc)
and a
jr z, .NoUse
- ld hl, .UsableMenuDataHeader
+ ld hl, .UsableMenuHeader
ld de, .UsableJumptable
jr .proceed
.NoUse:
- ld hl, .UnusableMenuDataHeader
+ ld hl, .UnusableMenuHeader
ld de, .UnusableJumptable
.proceed
push de
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
pop hl
@@ -847,14 +847,14 @@ TMHMSubmenu: ; 105dc (4:45dc)
jp hl
; 10601 (4:4601)
-.UsableMenuDataHeader: ; 0x10601
+.UsableMenuHeader: ; 0x10601
db MENU_BACKUP_TILES ; flags
menu_coords 13, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .UsableMenuData2
+ dw .UsableMenuData
db 1 ; default option
; 0x10609
-.UsableMenuData2: ; 0x10609
+.UsableMenuData: ; 0x10609
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 2 ; items
db "USE@"
@@ -866,14 +866,14 @@ TMHMSubmenu: ; 105dc (4:45dc)
dw .Quit
; 10618
-.UnusableMenuDataHeader: ; 0x10618
+.UnusableMenuHeader: ; 0x10618
db MENU_BACKUP_TILES ; flags
menu_coords 13, 9, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .UnusableMenuData2
+ dw .UnusableMenuData
db 1 ; default option
; 0x10620
-.UnusableMenuData2: ; 0x10620
+.UnusableMenuData: ; 0x10620
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
db 1 ; items
db "QUIT@"
@@ -1006,8 +1006,8 @@ DepositSellPack: ; 106be
.ItemsPocket: ; 106d9 (4:46d9)
xor a ; ITEM_POCKET
call InitPocket
- ld hl, PC_Mart_ItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, PC_Mart_ItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
@@ -1022,8 +1022,8 @@ DepositSellPack: ; 106be
.KeyItemsPocket: ; 106ff (4:46ff)
ld a, KEY_ITEM_POCKET
call InitPocket
- ld hl, PC_Mart_KeyItemsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, PC_Mart_KeyItemsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
@@ -1047,8 +1047,8 @@ DepositSellPack: ; 106be
.BallsPocket: ; 1073b (4:473b)
ld a, BALL_POCKET
call InitPocket
- ld hl, PC_Mart_BallsPocketMenuDataHeader
- call CopyMenuDataHeader
+ ld hl, PC_Mart_BallsPocketMenuHeader
+ call CopyMenuHeader
ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
@@ -1153,18 +1153,18 @@ TutorialPack: ; 107bb
.Items: ; 107e9 (4:47e9)
xor a ; ITEM_POCKET
- ld hl, .ItemsMenuDataHeader
+ ld hl, .ItemsMenuHeader
jr .DisplayPocket
; 107ef (4:47ef)
-.ItemsMenuDataHeader: ; 0x107ef
+.ItemsMenuHeader: ; 0x107ef
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .ItemsMenuData2
+ dw .ItemsMenuData
db 1 ; default option
; 0x107f7
-.ItemsMenuData2: ; 0x107f7
+.ItemsMenuData: ; 0x107f7
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -1176,18 +1176,18 @@ TutorialPack: ; 107bb
.wKeyItems: ; 10807 (4:4807)
ld a, KEY_ITEM_POCKET
- ld hl, .KeyItemsMenuDataHeader
+ ld hl, .KeyItemsMenuHeader
jr .DisplayPocket
; 1080e (4:480e)
-.KeyItemsMenuDataHeader: ; 0x1080e
+.KeyItemsMenuHeader: ; 0x1080e
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .KeyItemsMenuData2
+ dw .KeyItemsMenuData
db 1 ; default option
; 0x10816
-.KeyItemsMenuData2: ; 0x10816
+.KeyItemsMenuData: ; 0x10816
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
@@ -1208,18 +1208,18 @@ TutorialPack: ; 107bb
.Balls: ; 1083b (4:483b)
ld a, BALL_POCKET
- ld hl, .BallsMenuDataHeader
+ ld hl, .BallsMenuHeader
jr .DisplayPocket
; 10842 (4:4842)
-.BallsMenuDataHeader: ; 0x10842
+.BallsMenuHeader: ; 0x10842
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .BallsMenuData2
+ dw .BallsMenuData
db 1 ; default option
; 0x1084a
-.BallsMenuData2: ; 0x1084a
+.BallsMenuData: ; 0x1084a
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -1233,7 +1233,7 @@ TutorialPack: ; 107bb
push hl
call InitPocket
pop hl
- call CopyMenuDataHeader
+ call CopyMenuHeader
call ScrollingMenu
ret
@@ -1288,7 +1288,7 @@ DrawPackGFX: ; 1089d
cp BATTLETYPE_TUTORIAL
jr z, .male_dude
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr nz, .female
.male_dude
ld hl, PackGFXPointers
@@ -1536,14 +1536,14 @@ Pack_InitColors: ; 10a40
ret
; 10a4f
-ItemsPocketMenuDataHeader: ; 0x10a4f
+ItemsPocketMenuHeader: ; 0x10a4f
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10a57
-.MenuData2: ; 0x10a57
+.MenuData: ; 0x10a57
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -1553,14 +1553,14 @@ ItemsPocketMenuDataHeader: ; 0x10a4f
dba UpdateItemDescription
; 10a67
-PC_Mart_ItemsPocketMenuDataHeader: ; 0x10a67
+PC_Mart_ItemsPocketMenuHeader: ; 0x10a67
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10a6f
-.MenuData2: ; 0x10a6f
+.MenuData: ; 0x10a6f
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -1570,14 +1570,14 @@ PC_Mart_ItemsPocketMenuDataHeader: ; 0x10a67
dba UpdateItemDescription
; 10a7f
-KeyItemsPocketMenuDataHeader: ; 0x10a7f
+KeyItemsPocketMenuHeader: ; 0x10a7f
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10a87
-.MenuData2: ; 0x10a87
+.MenuData: ; 0x10a87
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
@@ -1587,14 +1587,14 @@ KeyItemsPocketMenuDataHeader: ; 0x10a7f
dba UpdateItemDescription
; 10a97
-PC_Mart_KeyItemsPocketMenuDataHeader: ; 0x10a97
+PC_Mart_KeyItemsPocketMenuHeader: ; 0x10a97
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10a9f
-.MenuData2: ; 0x10a9f
+.MenuData: ; 0x10a9f
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
@@ -1604,14 +1604,14 @@ PC_Mart_KeyItemsPocketMenuDataHeader: ; 0x10a97
dba UpdateItemDescription
; 10aaf
-BallsPocketMenuDataHeader: ; 0x10aaf
+BallsPocketMenuHeader: ; 0x10aaf
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10ab7
-.MenuData2: ; 0x10ab7
+.MenuData: ; 0x10ab7
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -1621,14 +1621,14 @@ BallsPocketMenuDataHeader: ; 0x10aaf
dba UpdateItemDescription
; 10ac7
-PC_Mart_BallsPocketMenuDataHeader: ; 0x10ac7
+PC_Mart_BallsPocketMenuHeader: ; 0x10ac7
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x10acf
-.MenuData2: ; 0x10acf
+.MenuData: ; 0x10acf
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
diff --git a/engine/party_menu.asm b/engine/party_menu.asm
index 9dffa4089..fc1783c71 100644
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -417,7 +417,7 @@ PlacePartyMonEvoStoneCompatibility: ; 5022f
ld l, a
ld de, wStringBuffer1
ld a, BANK(EvosAttacks)
- ld bc, $a
+ ld bc, 10
call FarCopyBytes
ld hl, wStringBuffer1
.loop2
@@ -839,6 +839,7 @@ PrintPartyMenuActionText: ; 50566
; 5057b
.MenuActionTexts: ; 5057b
+; entries correspond to PARTYMENUTEXT_* constants
dw .Text_CuredOfPoison
dw .Text_BurnWasHealed
dw .Text_Defrosted
diff --git a/engine/phone/buenas_password.asm b/engine/phone/buenas_password.asm
index 0d144afa6..82a696648 100644
--- a/engine/phone/buenas_password.asm
+++ b/engine/phone/buenas_password.asm
@@ -2,7 +2,7 @@ BuenaPhoneScript1:
checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
iftrue BuenaPhoneScript_Rocket
checkcode VAR_HOUR
- if_greater_than 17, BuenaPhoneScript_AfterMidnight1
+ ifgreater 17, BuenaPhoneScript_AfterMidnight1
scall BuenaPhoneScript_CheckTimeOfDay1
jump BuenaPhoneScript_Random1
@@ -13,9 +13,9 @@ BuenaPhoneScript2:
jump BuenaPhoneScript_Random2
BuenaPhoneScript_CheckTimeOfDay1:
- checkmorn
+ checktime MORN
iftrue .morn
- checkday
+ checktime DAY
iftrue .day
writetext UnknownText_0xa0d42
buttonsound
@@ -37,10 +37,10 @@ BuenaPhoneScript_AfterMidnight1:
BuenaPhoneScript_CheckTimeOfDay2:
checkcode VAR_HOUR
- if_greater_than 17, BuenaPhoneScript_AfterMidnight2
- checkmorn
+ ifgreater 17, BuenaPhoneScript_AfterMidnight2
+ checktime MORN
iftrue .morn
- checkday
+ checktime DAY
iftrue .day
writetext UnknownText_0xa0e29
buttonsound
@@ -75,20 +75,20 @@ BuenaPhoneScript_Random2:
random 14
.Jumptable:
- if_equal 0, .zero
- if_equal 1, .one
- if_equal 2, .two
- if_equal 3, .three
- if_equal 4, .four
- if_equal 5, .five
- if_equal 6, .six
- if_equal 7, .seven
- if_equal 8, .eight
- if_equal 9, .nine
- if_equal 10, .ten
- if_equal 11, .eleven
- if_equal 12, .twelve
- if_equal 13, .thirteen
+ ifequal 0, .zero
+ ifequal 1, .one
+ ifequal 2, .two
+ ifequal 3, .three
+ ifequal 4, .four
+ ifequal 5, .five
+ ifequal 6, .six
+ ifequal 7, .seven
+ ifequal 8, .eight
+ ifequal 9, .nine
+ ifequal 10, .ten
+ ifequal 11, .eleven
+ ifequal 12, .twelve
+ ifequal 13, .thirteen
.zero
writetext UnknownText_0xa0efb
@@ -150,9 +150,9 @@ BuenaPhoneScript_Random2:
BuenaPhoneScript_Random1:
random 3
- if_equal 0, .zero
- if_equal 1, .one
- if_equal 2, .two
+ ifequal 0, .zero
+ ifequal 1, .one
+ ifequal 2, .two
.zero
writetext UnknownText_0xa1c88
diff --git a/engine/phone/generic_calls.asm b/engine/phone/generic_calls.asm
index 937fc67c0..b3b3eb56a 100644
--- a/engine/phone/generic_calls.asm
+++ b/engine/phone/generic_calls.asm
@@ -19,31 +19,31 @@ PhoneScript_Random11:
end
PhoneScript_AnswerPhone_Male:
- checkday
+ checktime DAY
iftrue PhoneScript_AnswerPhone_Male_Day
- checknite
+ checktime NITE
iftrue PhoneScript_AnswerPhone_Male_Nite
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4dc5
@@ -147,26 +147,26 @@ PhoneScript_AnswerPhone_Male:
PhoneScript_AnswerPhone_Male_Day:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4ded
@@ -270,26 +270,26 @@ PhoneScript_AnswerPhone_Male_Day:
PhoneScript_AnswerPhone_Male_Nite:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4e16
@@ -392,19 +392,19 @@ PhoneScript_AnswerPhone_Male_Nite:
end
PhoneScript_AnswerPhone_Female:
- checkday
+ checktime DAY
iftrue PhoneScript_AnswerPhone_Female_Day
- checknite
+ checktime NITE
iftrue PhoneScript_AnswerPhone_Female_Nite
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b4f21
@@ -448,14 +448,14 @@ PhoneScript_AnswerPhone_Female:
PhoneScript_AnswerPhone_Female_Day:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b4f4d
@@ -499,14 +499,14 @@ PhoneScript_AnswerPhone_Female_Day:
PhoneScript_AnswerPhone_Female_Nite:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b4f75
@@ -549,31 +549,31 @@ PhoneScript_AnswerPhone_Female_Nite:
end
PhoneScript_GreetPhone_Male:
- checkday
+ checktime DAY
iftrue PhoneScript_GreetPhone_Male_Day
- checknite
+ checktime NITE
iftrue PhoneScript_GreetPhone_Male_Nite
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4e3e
@@ -677,26 +677,26 @@ PhoneScript_GreetPhone_Male:
PhoneScript_GreetPhone_Male_Day:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4e72
@@ -800,26 +800,26 @@ PhoneScript_GreetPhone_Male_Day:
PhoneScript_GreetPhone_Male_Nite:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4e9e
@@ -922,19 +922,19 @@ PhoneScript_GreetPhone_Male_Nite:
end
PhoneScript_GreetPhone_Female:
- checkday
+ checktime DAY
iftrue PhoneScript_GreetPhone_Female_Day
- checknite
+ checktime NITE
iftrue PhoneScript_GreetPhone_Female_Nite
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b4fa1
@@ -978,14 +978,14 @@ PhoneScript_GreetPhone_Female:
PhoneScript_GreetPhone_Female_Day:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b4fda
@@ -1029,14 +1029,14 @@ PhoneScript_GreetPhone_Female_Day:
PhoneScript_GreetPhone_Female_Nite:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b5004
@@ -1080,23 +1080,23 @@ PhoneScript_GreetPhone_Female_Nite:
PhoneScript_Generic_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1b4ecd
@@ -1190,14 +1190,14 @@ PhoneScript_Generic_Male:
PhoneScript_Generic_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1b502b
@@ -1240,9 +1240,9 @@ PhoneScript_Generic_Female:
end
PhoneScript_MonFlavorText:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farscall PhoneScript_Random2
- if_equal $0, .TooEnergetic
+ ifequal $0, .TooEnergetic
farwritetext UnknownText_0x1b518b
buttonsound
farjump PhoneScript_HangupText_Male
diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm
index fad859bfe..633096cd9 100644
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -704,21 +704,7 @@ GetCallerName: ; 903a9 (24:43a9)
ret
; 903d6 (24:43d6)
-NonTrainerCallerNames: ; 903d6
- dw .none
- dw .mom
- dw .bikeshop
- dw .bill
- dw .elm
- dw .buena
-
-.none db "----------@"
-.mom db "MOM:@"
-.bill db "BILL:@"
-.elm db "PROF.ELM:@"
-.bikeshop db "BIKE SHOP:@"
-.buena db "BUENA:<LNBRK> DISC JOCKEY@"
-; 90423
+INCLUDE "data/phone/non_trainer_names.asm"
Phone_GetTrainerName: ; 90423 (24:4423)
push hl
diff --git a/engine/phone/phone_callers.asm b/engine/phone/phone_callers.asm
index cb333ae8d..a929ba1d8 100644
--- a/engine/phone/phone_callers.asm
+++ b/engine/phone/phone_callers.asm
@@ -1,7 +1,7 @@
Phone_GenericCall_Male:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farscall PhoneScript_Random2
- if_equal 0, .Bragging
+ ifequal 0, .Bragging
farscall PhoneScript_Generic_Male
farjump Phone_FoundAMon_Male
@@ -9,9 +9,9 @@ Phone_GenericCall_Male:
farjump Phone_BraggingCall_Male
Phone_GenericCall_Female:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farscall PhoneScript_Random2
- if_equal 0, .Bragging
+ ifequal 0, .Bragging
farscall PhoneScript_Generic_Female
farjump Phone_FoundAMon_Female
@@ -27,9 +27,9 @@ Phone_BraggingCall_Female:
farjump Phone_FoundAMon_Female
Phone_FoundAMon_Male:
- special Special_RandomPhoneWildMon
+ special RandomPhoneWildMon
farscall PhoneScript_Random2
- if_equal 0, .GotAway
+ ifequal 0, .GotAway
farscall Phone_WhoDefeatedMon_Male
farjump PhoneScript_HangupText_Male
@@ -37,9 +37,9 @@ Phone_FoundAMon_Male:
farjump Phone_GotAwayCall_Male
Phone_FoundAMon_Female:
- special Special_RandomPhoneWildMon
+ special RandomPhoneWildMon
farscall PhoneScript_Random2
- if_equal 0, .GotAway
+ ifequal 0, .GotAway
farscall Phone_WhoDefeatedMon_Female
farjump PhoneScript_HangupText_Female
@@ -56,23 +56,23 @@ Phone_GotAwayCall_Female:
Phone_WhosBragging_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackIntelligenceText
@@ -161,14 +161,14 @@ Phone_WhosBragging_Male:
Phone_WhosBragging_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x174688
@@ -212,23 +212,23 @@ Phone_WhosBragging_Female:
Phone_WhoDefeatedMon_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext JackDefeatedMonText
@@ -317,14 +317,14 @@ Phone_WhoDefeatedMon_Male:
Phone_WhoDefeatedMon_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1746c3
@@ -368,23 +368,23 @@ Phone_WhoDefeatedMon_Female:
Phone_WhoLostAMon_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x174165
@@ -473,14 +473,14 @@ Phone_WhoLostAMon_Male:
Phone_WhoLostAMon_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x174734
@@ -532,23 +532,23 @@ PhoneScript_WantsToBattle_Female:
PhoneScript_RematchText_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x1741e1
@@ -637,13 +637,13 @@ PhoneScript_RematchText_Male:
PhoneScript_RematchText_Female:
checkcode VAR_CALLERID
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beth:
farwritetext UnknownText_0x174e4e
@@ -690,26 +690,26 @@ TiffanyItsAwful:
PhoneScript_HangupText_Male:
checkcode VAR_CALLERID
- if_equal PHONE_SCHOOLBOY_JACK, .Jack
- if_equal PHONE_SAILOR_HUEY, .Huey
- if_equal PHONE_COOLTRAINERM_GAVEN, .Gaven
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_YOUNGSTER_JOEY, .Joey
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_FISHER_RALPH, .Ralph
- if_equal PHONE_HIKER_ANTHONY, .Anthony
- if_equal PHONE_CAMPER_TODD, .Todd
- if_equal PHONE_JUGGLER_IRWIN, .Irwin
- if_equal PHONE_BUG_CATCHER_ARNIE, .Arnie
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_SCHOOLBOY_CHAD, .Chad
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_POKEMANIAC_BRENT, .Brent
- if_equal PHONE_BIRDKEEPER_VANCE, .Vance
- if_equal PHONE_FISHER_WILTON, .Wilton
- if_equal PHONE_BLACKBELT_KENJI, .Kenji
- if_equal PHONE_HIKER_PARRY, .Parry
+ ifequal PHONE_SCHOOLBOY_JACK, .Jack
+ ifequal PHONE_SAILOR_HUEY, .Huey
+ ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_YOUNGSTER_JOEY, .Joey
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_FISHER_RALPH, .Ralph
+ ifequal PHONE_HIKER_ANTHONY, .Anthony
+ ifequal PHONE_CAMPER_TODD, .Todd
+ ifequal PHONE_JUGGLER_IRWIN, .Irwin
+ ifequal PHONE_BUG_CATCHER_ARNIE, .Arnie
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_SCHOOLBOY_CHAD, .Chad
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_POKEMANIAC_BRENT, .Brent
+ ifequal PHONE_BIRDKEEPER_VANCE, .Vance
+ ifequal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BLACKBELT_KENJI, .Kenji
+ ifequal PHONE_HIKER_PARRY, .Parry
.Jack:
farwritetext UnknownText_0x174251
@@ -793,14 +793,14 @@ PhoneScript_HangupText_Male:
PhoneScript_HangupText_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_COOLTRAINERF_BETH, .Beth
- if_equal PHONE_COOLTRAINERF_REENA, .Reena
- if_equal PHONE_PICNICKER_LIZ, .Liz
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
- if_equal PHONE_PICNICKER_ERIN, .Erin
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_COOLTRAINERF_BETH, .Beth
+ ifequal PHONE_COOLTRAINERF_REENA, .Reena
+ ifequal PHONE_PICNICKER_LIZ, .Liz
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_PICNICKER_ERIN, .Erin
.Beverly:
farwritetext UnknownText_0x1747ac
@@ -851,13 +851,13 @@ Phone_CheckIfUnseenRare_Female:
farjump PhoneScript_HangupText_Female
PhoneScriptRareWildMon:
- special Special_RandomUnseenWildMon
+ special RandomUnseenWildMon
end
PhoneScript_BugCatchingContest:
checkcode VAR_CALLERID
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_POKEFANM_DEREK, .Derek
.Wade:
farwritetext WadeBugCatchingContestText
@@ -896,12 +896,12 @@ UnknownScript_0xa05de:
PhoneScript_FoundItem_Male:
checkcode VAR_CALLERID
- if_equal PHONE_BIRDKEEPER_JOSE, .Jose
- if_equal PHONE_BUG_CATCHER_WADE, .Wade
- if_equal PHONE_SCHOOLBOY_ALAN, .Alan
- if_equal PHONE_POKEFANM_DEREK, .Derek
- if_equal PHONE_FISHER_TULLY, .Tully
- if_equal PHONE_FISHER_WILTON, .Wilton
+ ifequal PHONE_BIRDKEEPER_JOSE, .Jose
+ ifequal PHONE_BUG_CATCHER_WADE, .Wade
+ ifequal PHONE_SCHOOLBOY_ALAN, .Alan
+ ifequal PHONE_POKEFANM_DEREK, .Derek
+ ifequal PHONE_FISHER_TULLY, .Tully
+ ifequal PHONE_FISHER_WILTON, .Wilton
.Jose:
farwritetext JoseFoundSomethingText
@@ -929,10 +929,10 @@ PhoneScript_FoundItem_Male:
PhoneScript_FoundItem_Female:
checkcode VAR_CALLERID
- if_equal PHONE_POKEFAN_BEVERLY, .Beverly
- if_equal PHONE_PICNICKER_GINA, .Gina
- if_equal PHONE_LASS_DANA, .Dana
- if_equal PHONE_PICNICKER_TIFFANY, .Tiffany
+ ifequal PHONE_POKEFAN_BEVERLY, .Beverly
+ ifequal PHONE_PICNICKER_GINA, .Gina
+ ifequal PHONE_LASS_DANA, .Dana
+ ifequal PHONE_PICNICKER_TIFFANY, .Tiffany
.Beverly:
farwritetext BeverlyFoundNuggetText
diff --git a/engine/phone/phone_gossip.asm b/engine/phone/phone_gossip.asm
index 8f45c8807..9a37c72cf 100644
--- a/engine/phone/phone_gossip.asm
+++ b/engine/phone/phone_gossip.asm
@@ -1,16 +1,16 @@
JackTriviaScript:
random 11
- if_equal 0, .Thunder
- if_equal 1, .Rollout
- if_equal 2, .Solarbeam
- if_equal 3, .Stomp
- if_equal 4, .Gust
- if_equal 5, .Twister
- if_equal 6, .Earthquake
- if_equal 7, .Magnitude
- if_equal 8, .Sandstorm
- if_equal 9, .SunnyDay
- if_equal 10, .RainDance
+ ifequal 0, .Thunder
+ ifequal 1, .Rollout
+ ifequal 2, .Solarbeam
+ ifequal 3, .Stomp
+ ifequal 4, .Gust
+ ifequal 5, .Twister
+ ifequal 6, .Earthquake
+ ifequal 7, .Magnitude
+ ifequal 8, .Sandstorm
+ ifequal 9, .SunnyDay
+ ifequal 10, .RainDance
.Thunder:
farwritetext JackThunderTriviaText
@@ -69,16 +69,16 @@ JackTriviaScript:
UnknownScript_0xa06da:
random 10
- if_equal 0, .RuinsOfAlph
- if_equal 1, .Falkner
- if_equal 2, .Earl
- if_equal 3, .SurfPikachu
- if_equal 4, .MooMooMilk
- if_equal 5, .Salon
- if_equal 6, .Whitney
- if_equal 7, .BugCatchingContest
- if_equal 8, .BeautifulMon
- if_equal 9, .Forgot
+ ifequal 0, .RuinsOfAlph
+ ifequal 1, .Falkner
+ ifequal 2, .Earl
+ ifequal 3, .SurfPikachu
+ ifequal 4, .MooMooMilk
+ ifequal 5, .Salon
+ ifequal 6, .Whitney
+ ifequal 7, .BugCatchingContest
+ ifequal 8, .BeautifulMon
+ ifequal 9, .Forgot
.RuinsOfAlph:
farwritetext UnknownText_0x176223
@@ -132,16 +132,16 @@ UnknownScript_0xa06da:
ChadOakGossipScript:
random 10
- if_equal 0, .Blue
- if_equal 1, .Daisy
- if_equal 2, .ProfElm
- if_equal 3, .Dream
- if_equal 4, .Kurt
- if_equal 5, .League
- if_equal 6, .RadioShow
- if_equal 7, .Battling
- if_equal 8, .DaisyTea
- if_equal 9, .Traveled
+ ifequal 0, .Blue
+ ifequal 1, .Daisy
+ ifequal 2, .ProfElm
+ ifequal 3, .Dream
+ ifequal 4, .Kurt
+ ifequal 5, .League
+ ifequal 6, .RadioShow
+ ifequal 7, .Battling
+ ifequal 8, .DaisyTea
+ ifequal 9, .Traveled
.Blue:
farwritetext ChadBlueGossipText
@@ -195,16 +195,16 @@ ChadOakGossipScript:
BrentBillTriviaScript:
random 10
- if_equal 0, .Father
- if_equal 1, .Grandpa
- if_equal 2, .Goldenrod
- if_equal 3, .Route25
- if_equal 4, .Abra
- if_equal 5, .Sister
- if_equal 6, .Milk
- if_equal 7, .Battling
- if_equal 8, .FlowerShop
- if_equal 9, .KimonoGirl
+ ifequal 0, .Father
+ ifequal 1, .Grandpa
+ ifequal 2, .Goldenrod
+ ifequal 3, .Route25
+ ifequal 4, .Abra
+ ifequal 5, .Sister
+ ifequal 6, .Milk
+ ifequal 7, .Battling
+ ifequal 8, .FlowerShop
+ ifequal 9, .KimonoGirl
.Father:
farwritetext UnknownText_0x662bc
@@ -477,9 +477,9 @@ ErinWorkingHardScript:
UnknownScript_0xa09c8:
random 3
- if_equal 0, UnknownScript_0xa09d6
- if_equal 1, UnknownScript_0xa09de
- if_equal 2, UnknownScript_0xa09e6
+ ifequal 0, UnknownScript_0xa09d6
+ ifequal 1, UnknownScript_0xa09de
+ ifequal 2, UnknownScript_0xa09e6
UnknownScript_0xa09d6:
farwritetext UnknownText_0x64846
@@ -498,8 +498,8 @@ UnknownScript_0xa09e6:
KenjiAnswerPhoneScript:
checkcode VAR_KENJI_BREAK
- if_equal 2, .Training
- if_equal 1, .OnBreak
+ ifequal 2, .Training
+ ifequal 1, .OnBreak
farwritetext UnknownText_0x66e17
buttonsound
jump PhoneScript_HangupText_Male
@@ -510,9 +510,9 @@ KenjiAnswerPhoneScript:
jump PhoneScript_HangupText_Male
.OnBreak:
- checkmorn
+ checktime MORN
iftrue .Morning
- checknite
+ checktime NITE
iftrue .Night
setevent EVENT_KENJI_ON_BREAK
farwritetext KenjiBreakText
diff --git a/engine/phone/phone_scripts.asm b/engine/phone/phone_scripts.asm
index 646040641..87bc227b3 100644
--- a/engine/phone/phone_scripts.asm
+++ b/engine/phone/phone_scripts.asm
@@ -16,14 +16,14 @@ MomPhoneScript: ; 0xbceaa
jump MomPhoneNoPokemonScript
.bcec5 ; 0xbcec5
- checkevent EVENT_IN_YOUR_ROOM
+ checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_8
iftrue MomPhoneHangUpScript
farwritetext MomPhoneGreetingText
buttonsound
mapnametotext MEM_BUFFER_0
checkcode VAR_ROOFPALETTE
- if_equal 1, MomPhonePalette1
- if_equal 2, MomPhonePalette2
+ ifequal 1, MomPhonePalette1
+ ifequal 2, MomPhonePalette2
jump MomPhoneOther
MomPhoneLandmark: ; 0xbcedf
@@ -33,11 +33,11 @@ MomPhoneLandmark: ; 0xbcedf
MomPhonePalette1: ; 0xbcee7
checkcode VAR_MAPGROUP
- if_equal GROUP_NEW_BARK_TOWN, .newbark
- if_equal GROUP_CHERRYGROVE_CITY, .cherrygrove
- if_equal GROUP_VIOLET_CITY, .violet
- if_equal GROUP_AZALEA_TOWN, .azalea
- if_equal GROUP_GOLDENROD_CITY, .goldenrod
+ ifequal GROUP_NEW_BARK_TOWN, .newbark
+ ifequal GROUP_CHERRYGROVE_CITY, .cherrygrove
+ ifequal GROUP_VIOLET_CITY, .violet
+ ifequal GROUP_AZALEA_TOWN, .azalea
+ ifequal GROUP_GOLDENROD_CITY, .goldenrod
farwritetext MomPhoneGenericAreaText
buttonsound
jump MomSavingMoney
@@ -76,12 +76,12 @@ MomSavingMoney: ; 0xbcf37
checkflag ENGINE_MOM_SAVING_MONEY
iffalse MomIsNotSaving
checkmoney MOMS_MONEY, 0
- if_equal HAVE_MORE, MomSavingHasMoney
+ ifequal HAVE_MORE, MomSavingHasMoney
jump MomSavingButBroke
MomIsNotSaving: ; 0xbcf49
checkmoney MOMS_MONEY, 0
- if_equal HAVE_MORE, MomHasMoney
+ ifequal HAVE_MORE, MomHasMoney
jump MomHasNoMoney
MomSavingHasMoney: ; 0xbcf55
@@ -140,7 +140,7 @@ MomPhoneNoGymQuestScript: ; 0xbcfac
MomPhoneLectureScript: ; 0xbcfb1
setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
- setflag ENGINE_DST
+ setflag ENGINE_MOM_ACTIVE
specialphonecall SPECIALCALL_NONE
farwritetext MomPhoneLectureText
yesorno
@@ -150,9 +150,9 @@ MomPhoneLectureScript: ; 0xbcfb1
; Bill
BillPhoneScript1: ; 0xbcfc5
- checkday
+ checktime DAY
iftrue .daygreet
- checknite
+ checktime NITE
iftrue .nitegreet
farwritetext BillPhoneMornGreetingText
buttonsound
@@ -173,8 +173,8 @@ BillPhoneScript1: ; 0xbcfc5
buttonsound
checkcode VAR_BOXSPACE
vartomem MEM_BUFFER_0
- if_equal 0, .full
- if_less_than PARTY_LENGTH, .nearlyfull
+ ifequal 0, .full
+ ifless PARTY_LENGTH, .nearlyfull
farwritetext BillPhoneNotFullText
end
@@ -195,7 +195,7 @@ BillPhoneScript2: ; 0xbd007
ElmPhoneScript1: ; 0xbd00d
checkcode VAR_SPECIALPHONECALL
- if_equal SPECIALCALL_POKERUS, .pokerus
+ ifequal SPECIALCALL_POKERUS, .pokerus
checkevent EVENT_SHOWED_TOGEPI_TO_ELM
iftrue .discovery
checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
@@ -243,7 +243,7 @@ ElmPhoneScript1: ; 0xbd00d
.discovery ; 0xbd069
random 2
- if_equal 0, .nextdiscovery
+ ifequal 0, .nextdiscovery
farwritetext ElmPhoneDiscovery1Text
end
@@ -258,11 +258,11 @@ ElmPhoneScript1: ; 0xbd00d
ElmPhoneScript2: ; 0xbd081
checkcode VAR_SPECIALPHONECALL
- if_equal SPECIALCALL_ROBBED, .disaster
- if_equal SPECIALCALL_ASSISTANT, .assistant
- if_equal SPECIALCALL_WEIRDBROADCAST, .rocket
- if_equal SPECIALCALL_SSTICKET, .gift
- if_equal SPECIALCALL_MASTERBALL, .gift
+ ifequal SPECIALCALL_ROBBED, .disaster
+ ifequal SPECIALCALL_ASSISTANT, .assistant
+ ifequal SPECIALCALL_WEIRDBROADCAST, .rocket
+ ifequal SPECIALCALL_SSTICKET, .gift
+ ifequal SPECIALCALL_MASTERBALL, .gift
farwritetext ElmPhonePokerusText
specialphonecall SPECIALCALL_NONE
end
@@ -306,8 +306,8 @@ JackPhoneScript1:
checkflag ENGINE_JACK_MONDAY_MORNING
iftrue .NotMonday
checkcode VAR_WEEKDAY
- if_not_equal MONDAY, .NotMonday
- checkmorn
+ ifnotequal MONDAY, .NotMonday
+ checktime MORN
iftrue JackMondayMorning
.NotMonday:
@@ -321,17 +321,17 @@ JackPhoneScript2:
trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0
farscall PhoneScript_GreetPhone_Male
farscall PhoneScript_Random2
- if_equal 0, JackBattleTrivia
+ ifequal 0, JackBattleTrivia
checkflag ENGINE_JACK
iftrue .WaitingForBattle
checkflag ENGINE_JACK_MONDAY_MORNING
iftrue .WaitingForBattle
farscall PhoneScript_Random2
- if_equal 0, JackWantsToBattle
+ ifequal 0, JackWantsToBattle
.WaitingForBattle:
farscall PhoneScript_Random3
- if_equal 0, JackFindsRare
+ ifequal 0, JackFindsRare
farjump Phone_GenericCall_Male
JackMondayMorning:
@@ -367,7 +367,7 @@ BeverlyPhoneScript2:
checkflag ENGINE_BEVERLY_HAS_NUGGET
iftrue .HasNugget
farscall PhoneScript_Random4
- if_equal 0, .FoundNugget
+ ifequal 0, .FoundNugget
.HasNugget:
farjump Phone_GenericCall_Female
@@ -387,12 +387,12 @@ HueyPhoneScript1:
checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
iftrue .NotWednesday
checkcode VAR_WEEKDAY
- if_not_equal WEDNESDAY, .NotWednesday
- checknite
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime NITE
iftrue HueyWednesdayNight
.NotWednesday:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farjump UnknownScript_0xa0908
.WantsBattle:
@@ -407,8 +407,8 @@ HueyPhoneScript2:
checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
iftrue .Flavor
farscall PhoneScript_Random3
- if_equal 0, HueyWantsBattle
- if_equal 1, HueyWantsBattle
+ ifequal 0, HueyWantsBattle
+ ifequal 1, HueyWantsBattle
.Flavor:
farjump PhoneScript_MonFlavorText
@@ -431,8 +431,8 @@ GavenPhoneScript1:
checkflag ENGINE_GAVEN_THURSDAY_MORNING
iftrue .NotThursday
checkcode VAR_WEEKDAY
- if_not_equal THURSDAY, .NotThursday
- checkmorn
+ ifnotequal THURSDAY, .NotThursday
+ checktime MORN
iftrue GavenThursdayMorning
.NotThursday:
@@ -450,11 +450,11 @@ GavenPhoneScript2:
checkflag ENGINE_GAVEN_THURSDAY_MORNING
iftrue .WaitingForBattle
farscall PhoneScript_Random2
- if_equal 0, GavenWantsRematch
+ ifequal 0, GavenWantsRematch
.WaitingForBattle:
farscall PhoneScript_Random3
- if_equal 0, GavenFoundRare
+ ifequal 0, GavenFoundRare
farjump Phone_GenericCall_Male
GavenThursdayMorning:
@@ -478,8 +478,8 @@ BethPhoneScript1:
checkflag ENGINE_BETH_FRIDAY_AFTERNOON
iftrue .NotFriday
checkcode VAR_WEEKDAY
- if_not_equal FRIDAY, .NotFriday
- checkday
+ ifnotequal FRIDAY, .NotFriday
+ checktime DAY
iftrue BethFridayAfternoon
.NotFriday:
@@ -497,7 +497,7 @@ BethPhoneScript2:
checkflag ENGINE_BETH_FRIDAY_AFTERNOON
iftrue .Generic
farscall PhoneScript_Random2
- if_equal 0, BethWantsBattle
+ ifequal 0, BethWantsBattle
.Generic:
farjump Phone_GenericCall_Female
@@ -522,8 +522,8 @@ JosePhoneScript1:
checkflag ENGINE_JOSE_HAS_STAR_PIECE
iftrue .HasItem
checkcode VAR_WEEKDAY
- if_not_equal SATURDAY, .NotSaturday
- checknite
+ ifnotequal SATURDAY, .NotSaturday
+ checktime NITE
iftrue JoseSaturdayNight
.NotSaturday:
@@ -547,13 +547,13 @@ JosePhoneScript2:
checkflag ENGINE_JOSE_HAS_STAR_PIECE
iftrue .Generic
farscall PhoneScript_Random3
- if_equal 0, JoseWantsBattle
+ ifequal 0, JoseWantsBattle
farscall PhoneScript_Random3
- if_equal 0, JoseHasStarPiece
+ ifequal 0, JoseHasStarPiece
.Generic:
farscall PhoneScript_Random3
- if_equal 0, JoseFoundRare
+ ifequal 0, JoseFoundRare
farjump Phone_GenericCall_Male
JoseSaturdayNight:
@@ -582,8 +582,8 @@ ReenaPhoneScript1:
checkflag ENGINE_REENA_SUNDAY_MORNING
iftrue .NotSunday
checkcode VAR_WEEKDAY
- if_not_equal SUNDAY, .NotSunday
- checkmorn
+ ifnotequal SUNDAY, .NotSunday
+ checktime MORN
iftrue ReenaSundayMorning
.NotSunday:
@@ -601,7 +601,7 @@ ReenaPhoneScript2:
checkflag ENGINE_REENA_SUNDAY_MORNING
iftrue .Generic
farscall PhoneScript_Random2
- if_equal 0, ReenaWantsBattle
+ ifequal 0, ReenaWantsBattle
.Generic:
farjump Phone_GenericCall_Female
@@ -624,12 +624,12 @@ JoeyPhoneScript1:
checkflag ENGINE_JOEY_MONDAY_AFTERNOON
iftrue .NotMonday
checkcode VAR_WEEKDAY
- if_not_equal MONDAY, .NotMonday
- checkday
+ ifnotequal MONDAY, .NotMonday
+ checktime DAY
iftrue JoeyMondayAfternoon
.NotMonday:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farjump UnknownScript_0xa0930
.WantsBattle:
@@ -644,8 +644,8 @@ JoeyPhoneScript2:
checkflag ENGINE_JOEY_MONDAY_AFTERNOON
iftrue .Generic
farscall PhoneScript_Random3
- if_equal 0, JoeyWantsBattle
- if_equal 1, JoeyWantsBattle
+ ifequal 0, JoeyWantsBattle
+ ifequal 1, JoeyWantsBattle
.Generic:
farjump Phone_GenericCall_Male
@@ -670,19 +670,19 @@ WadePhoneScript1:
checkflag ENGINE_WADE_HAS_ITEM
iftrue WadeHasItem
checkcode VAR_WEEKDAY
- if_not_equal TUESDAY, .NotTuesday
- checknite
+ ifnotequal TUESDAY, .NotTuesday
+ checktime NITE
iftrue WadeTuesdayNight
.NotTuesday:
farscall PhoneScript_Random2
- if_equal 0, .NoContest
+ ifequal 0, .NoContest
checkflag ENGINE_DAILY_BUG_CONTEST
iftrue .NoContest
checkcode VAR_WEEKDAY
- if_equal TUESDAY, WadeContestToday
- if_equal THURSDAY, WadeContestToday
- if_equal SATURDAY, WadeContestToday
+ ifequal TUESDAY, WadeContestToday
+ ifequal THURSDAY, WadeContestToday
+ ifequal SATURDAY, WadeContestToday
.NoContest:
farjump UnknownScript_0xa0938
@@ -702,13 +702,13 @@ WadePhoneScript2:
trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0
farscall PhoneScript_GreetPhone_Male
farscall PhoneScript_Random2
- if_equal 0, .NoContest
+ ifequal 0, .NoContest
checkflag ENGINE_DAILY_BUG_CONTEST
iftrue .NoContest
checkcode VAR_WEEKDAY
- if_equal TUESDAY, Wade_ContestToday
- if_equal THURSDAY, Wade_ContestToday
- if_equal SATURDAY, Wade_ContestToday
+ ifequal TUESDAY, Wade_ContestToday
+ ifequal THURSDAY, Wade_ContestToday
+ ifequal SATURDAY, Wade_ContestToday
.NoContest:
checkflag ENGINE_WADE
@@ -718,15 +718,15 @@ WadePhoneScript2:
checkflag ENGINE_WADE_HAS_ITEM
iftrue .next
farscall PhoneScript_Random2
- if_equal 0, WadeHasItem2
+ ifequal 0, WadeHasItem2
checkflag ENGINE_FLYPOINT_GOLDENROD
iffalse .next
farscall PhoneScript_Random2
- if_equal 0, WadeWantsBattle2
+ ifequal 0, WadeWantsBattle2
.next:
farscall PhoneScript_Random3
- if_equal 0, WadeFoundRare
+ ifequal 0, WadeFoundRare
farjump Phone_GenericCall_Male
Wade_ContestToday:
@@ -751,10 +751,10 @@ WadeHasItem2:
clearevent EVENT_WADE_HAS_PRZCUREBERRY
clearevent EVENT_WADE_HAS_BITTER_BERRY
random 4
- if_equal 0, .Berry
- if_equal 1, .PsnCureBerry
- if_equal 2, .PrzCureBerry
- if_equal 3, .Bitterberry
+ ifequal 0, .Berry
+ ifequal 1, .PsnCureBerry
+ ifequal 2, .PrzCureBerry
+ ifequal 3, .Bitterberry
.Berry:
setevent EVENT_WADE_HAS_BERRY
@@ -784,11 +784,11 @@ RalphPhoneScript1:
checkflag ENGINE_RALPH_WEDNESDAY_MORNING
iftrue Ralph_CheckSwarm
checkcode VAR_WEEKDAY
- if_not_equal WEDNESDAY, Ralph_CheckSwarm
- checkmorn
+ ifnotequal WEDNESDAY, Ralph_CheckSwarm
+ checktime MORN
iftrue Ralph_WednesdayMorning
Ralph_CheckSwarm:
- checkflag ENGINE_SPECIAL_WILDDATA
+ checkflag ENGINE_FISH_SWARM
iftrue Ralph_ReportSwarm
farjump UnknownScript_0xa0940
@@ -810,10 +810,10 @@ RalphPhoneScript2:
checkflag ENGINE_RALPH_WEDNESDAY_MORNING
iftrue Ralph_CheckSwarm2
farscall PhoneScript_Random2
- if_equal 0, Ralph_FightMe
+ ifequal 0, Ralph_FightMe
Ralph_CheckSwarm2:
farscall PhoneScript_Random5
- if_equal 0, Ralph_SetUpSwarm
+ ifequal 0, Ralph_SetUpSwarm
farjump Phone_GenericCall_Male
Ralph_WednesdayMorning:
@@ -824,13 +824,13 @@ Ralph_FightMe:
farjump PhoneScript_WantsToBattle_Male
Ralph_SetUpSwarm:
- checkflag ENGINE_SPECIAL_WILDDATA
+ checkflag ENGINE_FISH_SWARM
iftrue .Generic
- setflag ENGINE_SPECIAL_WILDDATA
+ setflag ENGINE_FISH_SWARM
pokenamemem QWILFISH, MEM_BUFFER_1
landmarktotext ROUTE_32, MEM_BUFFER_2
writebyte FISHSWARM_QWILFISH
- special Special_ActivateFishingSwarm
+ special ActivateFishingSwarm
farjump UnknownScript_0xa05d6
.Generic:
@@ -846,12 +846,12 @@ LizPhoneScript1:
checkflag ENGINE_LIZ_THURSDAY_AFTERNOON
iftrue .NotThursday
checkcode VAR_WEEKDAY
- if_not_equal THURSDAY, .NotThursday
- checkday
+ ifnotequal THURSDAY, .NotThursday
+ checktime DAY
iftrue LizThursdayAfternoon
.NotThursday:
- special Special_RandomPhoneMon
+ special RandomPhoneMon
farjump UnknownScript_0xa0948
.WantsBattle:
@@ -861,7 +861,7 @@ LizPhoneScript1:
LizPhoneScript2:
trainertotext PICNICKER, LIZ1, MEM_BUFFER_0
farscall PhoneScript_Random4
- if_equal 0, LizWrongNumber
+ ifequal 0, LizWrongNumber
farscall PhoneScript_GreetPhone_Female
checkflag ENGINE_LIZ
iftrue .next
@@ -870,11 +870,11 @@ LizPhoneScript2:
.next:
farscall PhoneScript_Random2
- if_equal 0, LizGossip
+ ifequal 0, LizGossip
checkflag ENGINE_FLYPOINT_GOLDENROD
iffalse .Generic
farscall PhoneScript_Random2
- if_equal 0, LizWantsBattle
+ ifequal 0, LizWantsBattle
.Generic:
farjump Phone_GenericCall_Female
@@ -892,15 +892,15 @@ LizWrongNumber:
LizGossip:
random 9
- if_equal 0, .CoolTrainerM
- if_equal 1, .Beauty
- if_equal 2, .Grunt
- if_equal 3, .Teacher
- if_equal 4, .SwimmerF
- if_equal 5, .KimonoGirl
- if_equal 6, .Skier
- if_equal 7, .Medium
- if_equal 8, .PokefanM
+ ifequal 0, .CoolTrainerM
+ ifequal 1, .Beauty
+ ifequal 2, .Grunt
+ ifequal 3, .Teacher
+ ifequal 4, .SwimmerF
+ ifequal 5, .KimonoGirl
+ ifequal 6, .Skier
+ ifequal 7, .Medium
+ ifequal 8, .PokefanM
.CoolTrainerM:
trainerclassname COOLTRAINERM, NICK
@@ -951,8 +951,8 @@ AnthonyPhoneScript1:
checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
iftrue .NotFriday
checkcode VAR_WEEKDAY
- if_not_equal FRIDAY, .NotFriday
- checknite
+ ifnotequal FRIDAY, .NotFriday
+ checktime NITE
iftrue AnthonyFridayNight
.NotFriday:
@@ -978,11 +978,11 @@ AnthonyPhoneScript2:
checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
iftrue .TriesSwarm
farscall PhoneScript_Random2
- if_equal 0, AnthonyWantsBattle
+ ifequal 0, AnthonyWantsBattle
.TriesSwarm:
farscall PhoneScript_Random5
- if_equal 0, AnthonyTriesDunsparceSwarm
+ ifequal 0, AnthonyTriesDunsparceSwarm
farjump Phone_GenericCall_Male
AnthonyFridayNight:
@@ -1015,8 +1015,8 @@ ToddPhoneScript1:
checkflag ENGINE_TODD_SATURDAY_MORNING
iftrue .NotSaturday
checkcode VAR_WEEKDAY
- if_not_equal SATURDAY, .NotSaturday
- checkmorn
+ ifnotequal SATURDAY, .NotSaturday
+ checktime MORN
iftrue ToddSaturdayMorning
.NotSaturday:
@@ -1041,15 +1041,15 @@ ToddPhoneScript2:
checkflag ENGINE_FLYPOINT_GOLDENROD
iffalse ToddNoGoldenrod
farscall PhoneScript_Random2
- if_equal 0, ToddWantsBattle
+ ifequal 0, ToddWantsBattle
.TryForSale:
farscall PhoneScript_Random2
- if_equal 0, ToddDeptStoreSale
+ ifequal 0, ToddDeptStoreSale
ToddNoGoldenrod:
farscall PhoneScript_Random3
- if_equal 0, ToddFoundRare
+ ifequal 0, ToddFoundRare
farjump Phone_GenericCall_Male
ToddSaturdayMorning:
@@ -1079,8 +1079,8 @@ GinaPhoneScript1:
checkflag ENGINE_GINA_HAS_LEAF_STONE
iftrue .HasLeafStone
checkcode VAR_WEEKDAY
- if_not_equal SUNDAY, .NotSunday
- checkday
+ ifnotequal SUNDAY, .NotSunday
+ checktime DAY
iftrue GinaSundayDay
.NotSunday:
@@ -1113,15 +1113,15 @@ GinaPhoneScript2:
checkevent EVENT_GINA_GAVE_LEAF_STONE
iftrue .GaveLeafStone
farscall PhoneScript_Random2
- if_equal 0, GinaHasLeafStone
+ ifequal 0, GinaHasLeafStone
.GaveLeafStone:
farscall PhoneScript_Random11
- if_equal 0, GinaHasLeafStone
+ ifequal 0, GinaHasLeafStone
checkflag ENGINE_FLYPOINT_GOLDENROD
iffalse .Generic
farscall PhoneScript_Random3
- if_equal 0, GinaWantsBattle
+ ifequal 0, GinaWantsBattle
.Generic:
farjump Phone_GenericCall_Female
@@ -1174,8 +1174,8 @@ ArniePhoneScript1:
checkflag ENGINE_ARNIE_TUESDAY_MORNING
iftrue .NotTuesday
checkcode VAR_WEEKDAY
- if_not_equal TUESDAY, .NotTuesday
- checkmorn
+ ifnotequal TUESDAY, .NotTuesday
+ checktime MORN
iftrue ArnieTuesdayMorning
.NotTuesday:
@@ -1199,13 +1199,13 @@ ArniePhoneScript2:
checkflag ENGINE_ARNIE_TUESDAY_MORNING
iftrue .Swarm
farscall PhoneScript_Random2
- if_equal 0, ArnieWantsBattle
+ ifequal 0, ArnieWantsBattle
.Swarm:
farscall PhoneScript_Random5
- if_equal 0, ArnieYanmaSwarm
+ ifequal 0, ArnieYanmaSwarm
farscall PhoneScript_Random3
- if_equal 0, ArnieFoundRare
+ ifequal 0, ArnieFoundRare
farjump Phone_GenericCall_Male
ArnieTuesdayMorning:
@@ -1243,8 +1243,8 @@ AlanPhoneScript1:
checkflag ENGINE_ALAN_HAS_FIRE_STONE
iftrue .FireStone
checkcode VAR_WEEKDAY
- if_not_equal WEDNESDAY, .NotWednesday
- checkday
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime DAY
iftrue AlanWednesdayDay
.NotWednesday:
@@ -1268,15 +1268,15 @@ AlanPhoneScript2:
checkflag ENGINE_ALAN_HAS_FIRE_STONE
iftrue AlanGenericCall
farscall PhoneScript_Random3
- if_equal 0, AlanWantsBattle
+ ifequal 0, AlanWantsBattle
checkevent EVENT_ALAN_GAVE_FIRE_STONE
iftrue .FireStone
farscall PhoneScript_Random2
- if_equal 0, AlanHasFireStone
+ ifequal 0, AlanHasFireStone
.FireStone:
farscall PhoneScript_Random11
- if_equal 0, AlanHasFireStone
+ ifequal 0, AlanHasFireStone
AlanGenericCall:
farjump Phone_GenericCall_Male
@@ -1306,8 +1306,8 @@ DanaPhoneScript1:
checkflag ENGINE_DANA_HAS_THUNDERSTONE
iftrue .HasThunderstone
checkcode VAR_WEEKDAY
- if_not_equal THURSDAY, .NotThursday
- checknite
+ ifnotequal THURSDAY, .NotThursday
+ checktime NITE
iftrue DanaThursdayNight
.NotThursday:
@@ -1331,19 +1331,19 @@ DanaPhoneScript2:
checkflag ENGINE_DANA_HAS_THUNDERSTONE
iftrue .Generic
farscall PhoneScript_Random3
- if_equal 0, DanaWantsBattle
+ ifequal 0, DanaWantsBattle
checkevent EVENT_DANA_GAVE_THUNDERSTONE
iftrue .Thunderstone
farscall PhoneScript_Random2
- if_equal 0, DanaHasThunderstone
+ ifequal 0, DanaHasThunderstone
.Thunderstone:
farscall PhoneScript_Random11
- if_equal 0, DanaHasThunderstone
+ ifequal 0, DanaHasThunderstone
.Generic:
farscall PhoneScript_Random3
- if_equal 0, DanaFoundRare
+ ifequal 0, DanaFoundRare
farjump Phone_GenericCall_Female
DanaThursdayNight:
@@ -1372,8 +1372,8 @@ ChadPhoneScript1:
checkflag ENGINE_CHAD_FRIDAY_MORNING
iftrue .NotFriday
checkcode VAR_WEEKDAY
- if_not_equal FRIDAY, .NotFriday
- checkmorn
+ ifnotequal FRIDAY, .NotFriday
+ checktime MORN
iftrue ChadFridayMorning
.NotFriday:
@@ -1387,17 +1387,17 @@ ChadPhoneScript2:
trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0
farscall PhoneScript_GreetPhone_Male
farscall PhoneScript_Random2
- if_equal 0, ChadOakGossip
+ ifequal 0, ChadOakGossip
checkflag ENGINE_CHAD
iftrue .Generic
checkflag ENGINE_CHAD_FRIDAY_MORNING
iftrue .Generic
farscall PhoneScript_Random2
- if_equal 0, ChadWantsBattle
+ ifequal 0, ChadWantsBattle
.Generic:
farscall PhoneScript_Random3
- if_equal 0, ChadFoundRare
+ ifequal 0, ChadFoundRare
farjump Phone_GenericCall_Male
ChadFridayMorning:
@@ -1420,13 +1420,13 @@ DerekPhoneScript1:
checkflag ENGINE_DEREK_HAS_NUGGET
iftrue .Nugget
farscall PhoneScript_Random2
- if_equal 0, .NoContest
+ ifequal 0, .NoContest
checkflag ENGINE_DAILY_BUG_CONTEST
iftrue .NoContest
checkcode VAR_WEEKDAY
- if_equal TUESDAY, .ContestToday
- if_equal THURSDAY, .ContestToday
- if_equal SATURDAY, .ContestToday
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
.NoContest:
farjump UnknownScript_0xa0988
@@ -1442,17 +1442,17 @@ DerekPhoneScript2:
trainertotext POKEFANM, DEREK1, MEM_BUFFER_0
farscall PhoneScript_GreetPhone_Male
farscall PhoneScript_Random2
- if_equal 0, .NoContest
+ ifequal 0, .NoContest
checkflag ENGINE_DAILY_BUG_CONTEST
iftrue .NoContest
checkcode VAR_WEEKDAY
- if_equal TUESDAY, .ContestToday
- if_equal THURSDAY, .ContestToday
- if_equal SATURDAY, .ContestToday
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
.NoContest:
farscall PhoneScript_Random4
- if_equal 0, .Nugget
+ ifequal 0, .Nugget
farjump Phone_GenericCall_Male
.ContestToday:
@@ -1473,8 +1473,8 @@ TullyPhoneScript1:
checkflag ENGINE_TULLY_HAS_WATER_STONE
iftrue TullyHasWaterStone
checkcode VAR_WEEKDAY
- if_not_equal SUNDAY, .NotSunday
- checknite
+ ifnotequal SUNDAY, .NotSunday
+ checktime NITE
iftrue TullySundayNight
.NotSunday:
@@ -1498,15 +1498,15 @@ TullyPhoneScript2:
checkflag ENGINE_TULLY_HAS_WATER_STONE
iftrue .Generic
farscall PhoneScript_Random3
- if_equal 0, TullyWantsBattle
+ ifequal 0, TullyWantsBattle
checkevent EVENT_TULLY_GAVE_WATER_STONE
iftrue .WaterStone
farscall PhoneScript_Random2
- if_equal 0, TullyFoundWaterStone
+ ifequal 0, TullyFoundWaterStone
.WaterStone:
farscall PhoneScript_Random11
- if_equal 0, TullyFoundWaterStone
+ ifequal 0, TullyFoundWaterStone
.Generic:
farjump Phone_GenericCall_Male
@@ -1532,8 +1532,8 @@ BrentPhoneScript1:
checkflag ENGINE_BRENT_MONDAY_MORNING
iftrue .NotMonday
checkcode VAR_WEEKDAY
- if_not_equal MONDAY, .NotMonday
- checkmorn
+ ifnotequal MONDAY, .NotMonday
+ checktime MORN
iftrue BrentMondayMorning
.NotMonday:
@@ -1547,13 +1547,13 @@ BrentPhoneScript2:
trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0
farscall PhoneScript_GreetPhone_Male
farscall PhoneScript_Random2
- if_equal 0, BrentBillTrivia
+ ifequal 0, BrentBillTrivia
checkflag ENGINE_BRENT
iftrue .Generic
checkflag ENGINE_BRENT_MONDAY_MORNING
iftrue .Generic
farscall PhoneScript_Random2
- if_equal 0, BrentWantsBattle
+ ifequal 0, BrentWantsBattle
.Generic:
farjump Phone_GenericCall_Male
@@ -1579,8 +1579,8 @@ TiffanyPhoneScript1:
checkflag ENGINE_TIFFANY_HAS_PINK_BOW
iftrue .HasItem
checkcode VAR_WEEKDAY
- if_not_equal TUESDAY, .NotTuesday
- checkday
+ ifnotequal TUESDAY, .NotTuesday
+ checktime DAY
iftrue TiffanyTuesdayAfternoon
.NotTuesday:
@@ -1597,7 +1597,7 @@ TiffanyPhoneScript1:
TiffanyPhoneScript2:
trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0
farscall PhoneScript_Random4
- if_equal 0, TiffanysFamilyMembers
+ ifequal 0, TiffanysFamilyMembers
farscall PhoneScript_GreetPhone_Female
checkflag ENGINE_TIFFANY
iftrue TiffanyGenericCall
@@ -1606,15 +1606,15 @@ TiffanyPhoneScript2:
checkflag ENGINE_TIFFANY_HAS_PINK_BOW
iftrue TiffanyGenericCall
farscall PhoneScript_Random3
- if_equal 0, TiffanyWantsBattle
+ ifequal 0, TiffanyWantsBattle
checkevent EVENT_TIFFANY_GAVE_PINK_BOW
iftrue .PinkBow
farscall PhoneScript_Random2
- if_equal 0, TiffanyHasPinkBow
+ ifequal 0, TiffanyHasPinkBow
.PinkBow:
farscall PhoneScript_Random11
- if_equal 0, TiffanyHasPinkBow
+ ifequal 0, TiffanyHasPinkBow
TiffanyGenericCall:
farjump Phone_GenericCall_Female
@@ -1629,12 +1629,12 @@ TiffanyWantsBattle:
TiffanysFamilyMembers:
random 6
- if_equal 0, .Grandma
- if_equal 1, .Grandpa
- if_equal 2, .Mom
- if_equal 3, .Dad
- if_equal 4, .Sister
- if_equal 5, .Brother
+ ifequal 0, .Grandma
+ ifequal 1, .Grandpa
+ ifequal 2, .Mom
+ ifequal 3, .Dad
+ ifequal 4, .Sister
+ ifequal 5, .Brother
.Grandma:
stringtotext GrandmaString, MEM_BUFFER_1
@@ -1678,8 +1678,8 @@ VancePhoneScript1:
checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
iftrue .NotWednesday
checkcode VAR_WEEKDAY
- if_not_equal WEDNESDAY, .NotWednesday
- checknite
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime NITE
iftrue VanceWednesdayNight
.NotWednesday:
@@ -1697,8 +1697,8 @@ VancePhoneScript2:
checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
iftrue .WantsBattle
farscall PhoneScript_Random3
- if_equal 0, VanceWantsRematch
- if_equal 1, VanceWantsRematch
+ ifequal 0, VanceWantsRematch
+ ifequal 1, VanceWantsRematch
.WantsBattle:
farjump Phone_GenericCall_Male
@@ -1721,8 +1721,8 @@ WiltonPhoneScript1:
checkflag ENGINE_WILTON_HAS_ITEM
iftrue .HasItem
checkcode VAR_WEEKDAY
- if_not_equal THURSDAY, .NotThursday
- checkmorn
+ ifnotequal THURSDAY, .NotThursday
+ checktime MORN
iftrue WiltonThursdayMorning
.NotThursday:
@@ -1746,9 +1746,9 @@ WiltonPhoneScript2:
checkflag ENGINE_WILTON_HAS_ITEM
iftrue .GenericCall
farscall PhoneScript_Random2
- if_equal 0, WiltonWantsBattle
+ ifequal 0, WiltonWantsBattle
farscall PhoneScript_Random2
- if_equal 0, WiltonHasItem
+ ifequal 0, WiltonHasItem
.GenericCall:
farjump Phone_GenericCall_Male
@@ -1768,9 +1768,9 @@ WiltonHasItem:
clearevent EVENT_WILTON_HAS_GREAT_BALL
clearevent EVENT_WILTON_HAS_POKE_BALL
random 5
- if_equal 0, .UltraBall
+ ifequal 0, .UltraBall
random 3
- if_equal 0, .GreatBall
+ ifequal 0, .GreatBall
jump .PokeBall
.UltraBall:
@@ -1809,8 +1809,8 @@ ParryPhoneScript1:
checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
iftrue .WantsRematch
checkcode VAR_WEEKDAY
- if_not_equal FRIDAY, .WantsRematch
- checkday
+ ifnotequal FRIDAY, .WantsRematch
+ checktime DAY
iftrue ParryFridayDay
.WantsRematch:
@@ -1828,8 +1828,8 @@ ParryPhoneScript2:
checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
iftrue .GenericCall
farscall PhoneScript_Random2
- if_equal 0, ParryWantsBattle
- if_equal 1, ParryWantsBattle
+ ifequal 0, ParryWantsBattle
+ ifequal 1, ParryWantsBattle
.GenericCall:
farjump Phone_GenericCall_Male
@@ -1852,8 +1852,8 @@ ErinPhoneScript1:
checkflag ENGINE_ERIN_SATURDAY_NIGHT
iftrue .NotSaturday
checkcode VAR_WEEKDAY
- if_not_equal SATURDAY, .NotSaturday
- checknite
+ ifnotequal SATURDAY, .NotSaturday
+ checktime NITE
iftrue ErinSaturdayNight
.NotSaturday:
@@ -1871,8 +1871,8 @@ ErinPhoneScript2:
checkflag ENGINE_ERIN_SATURDAY_NIGHT
iftrue .GenericCall
farscall PhoneScript_Random3
- if_equal 0, ErinWantsBattle
- if_equal 1, ErinWantsBattle
+ ifequal 0, ErinWantsBattle
+ ifequal 1, ErinWantsBattle
.GenericCall:
farjump Phone_GenericCall_Female
diff --git a/engine/pic_animation.asm b/engine/pic_animation.asm
index a84c3f449..8781c2fd0 100644
--- a/engine/pic_animation.asm
+++ b/engine/pic_animation.asm
@@ -579,7 +579,7 @@ PokeAnim_CopyBitmaskToBuffer: ; d033b
poke_anim_box: MACRO
y = 7
rept \1
-x = 7 +- \1
+x = 7 + -\1
rept \1
db x + y
x = x + 1
diff --git a/engine/player_gfx.asm b/engine/player_gfx.asm
index 282d2e22f..deb16ad3a 100644
--- a/engine/player_gfx.asm
+++ b/engine/player_gfx.asm
@@ -1,7 +1,7 @@
Unreferenced_Function88248: ; 88248
ld c, CAL
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .okay
ld c, KAREN
@@ -56,13 +56,13 @@ MovePlayerPic: ; 88266
jr .loop
ShowPlayerNamingChoices: ; 88297
- ld hl, ChrisNameMenuDataHeader
+ ld hl, ChrisNameMenuHeader
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotGender
- ld hl, KrisNameMenuDataHeader
+ ld hl, KrisNameMenuHeader
.GotGender:
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
ld a, [wMenuCursorY]
dec a
@@ -76,7 +76,7 @@ GetPlayerNameArray: ; 88318 This Function is never called
ld hl, wPlayerName
ld de, MalePlayerNameArray
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .done
ld de, FemalePlayerNameArray
@@ -92,7 +92,7 @@ GetPlayerIcon: ; 8832c
ld b, BANK(ChrisSpriteGFX)
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .done
; Female
@@ -105,7 +105,7 @@ GetPlayerIcon: ; 8832c
GetCardPic: ; 8833e
ld hl, ChrisCardPic
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld hl, KrisCardPic
.GotClass:
@@ -131,7 +131,7 @@ INCBIN "gfx/trainer_card/trainer_card.2bpp"
GetPlayerBackpic: ; 88825
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, GetChrisBackpic
call GetKrisBackpic
ret
@@ -150,7 +150,7 @@ HOF_LoadTrainerFrontpic: ; 88840
ld [hBGMapMode], a
ld e, 0
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld e, 1
@@ -159,7 +159,7 @@ HOF_LoadTrainerFrontpic: ; 88840
ld [wTrainerClass], a
ld de, ChrisPic
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotPic
ld de, KrisPic
@@ -179,7 +179,7 @@ DrawIntroPlayerPic: ; 88874
; Get class
ld e, CHRIS
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld e, KRIS
.GotClass:
@@ -189,7 +189,7 @@ DrawIntroPlayerPic: ; 88874
; Load pic
ld de, ChrisPic
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .GotPic
ld de, KrisPic
.GotPic:
diff --git a/engine/player_movement.asm b/engine/player_movement.asm
index 83fdf64ba..ef9afc7ad 100755
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -19,7 +19,7 @@ DoPlayerMovement:: ; 80000
; Standing downhill instead moves down.
ld hl, wBikeFlags
- bit 2, [hl] ; downhill
+ bit BIKEFLAGS_DOWNHILL_F, [hl]
ret z
ld c, a
@@ -286,7 +286,7 @@ DoPlayerMovement:: ; 80000
jr nz, .walk
ld hl, wBikeFlags
- bit 2, [hl] ; downhill
+ bit BIKEFLAGS_DOWNHILL_F, [hl]
jr z, .fast
ld a, [wWalkingDirection]
@@ -673,7 +673,7 @@ DoPlayerMovement:: ; 80000
.CheckStrengthBoulder: ; 8036f
ld hl, wBikeFlags
- bit 0, [hl] ; using strength
+ bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .not_boulder
ld hl, OBJECT_DIRECTION_WALKING
diff --git a/engine/player_object.asm b/engine/player_object.asm
index b16afda5c..7d287dedb 100755
--- a/engine/player_object.asm
+++ b/engine/player_object.asm
@@ -25,25 +25,25 @@ SpawnPlayer: ; 8029
call CopyPlayerObjectTemplate
ld b, $0
call PlayerSpawn_ConvertCoords
- ld a, $0
+ ld a, PLAYER_OBJECT
call GetMapObject
ld hl, MAPOBJECT_COLOR
add hl, bc
ln e, PAL_NPC_RED, OBJECTTYPE_SCRIPT
ld a, [wPlayerSpriteSetupFlags]
- bit 2, a
+ bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .ok
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .ok
ln e, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT
.ok
ld [hl], e
- ld a, $0
+ ld a, PLAYER_OBJECT
ld [hMapObjectIndexBuffer], a
ld bc, wMapObjects
- ld a, $0
+ ld a, PLAYER_OBJECT
ld [hObjectStructIndexBuffer], a
ld de, wObjectStructs
call CopyMapObjectToObjectStruct
@@ -577,7 +577,7 @@ TrainerWalkToPlayer: ; 831e
call ComputePathToWalkToPlayer
ret
-Special_SurfStartStep: ; 8379
+SurfStartStep: ; 8379
call InitMovementBuffer
call .GetMovementData
call AppendToMovementBuffer
diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm
index 04b4a6472..2e36175ab 100644
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -108,7 +108,7 @@ InitPokedex: ; 40063
Pokedex_CheckUnlockedUnownMode: ; 400a2
ld a, [wStatusFlags]
- bit 1, a
+ bit STATUSFLAGS_UNOWN_DEX_F, a
jr nz, .unlocked
xor a
diff --git a/engine/pokedex/unown_dex.asm b/engine/pokedex/unown_dex.asm
index cc3d4a273..a35a266b7 100755
--- a/engine/pokedex/unown_dex.asm
+++ b/engine/pokedex/unown_dex.asm
@@ -49,4 +49,4 @@ PrintUnownWord: ; fba2e (3e:7a2e)
; fba5a (3e:7a5a)
-INCLUDE "data/unown_words.asm"
+INCLUDE "data/pokemon/unown_words.asm"
diff --git a/engine/pokegear.asm b/engine/pokegear.asm
index ea2afdc78..9fdf21f59 100755
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -411,13 +411,13 @@ Pokegear_FinishTilemap: ; 90eb0 (24:4eb0)
call ByteFill
ld de, wPokegearFlags
ld a, [de]
- bit 0, a ; ENGINE_MAP_CARD
+ bit POKEGEAR_MAP_CARD_F, a
call nz, .PlaceMapIcon
ld a, [de]
- bit 2, a ; ENGINE_PHONE_CARD
+ bit POKEGEAR_PHONE_CARD_F, a
call nz, .PlacePhoneIcon
ld a, [de]
- bit 1, a ; ENGINE_RADIO_CARD
+ bit POKEGEAR_RADIO_CARD_F, a
call nz, .PlaceRadioIcon
hlcoord 0, 0
ld a, $46
@@ -496,7 +496,7 @@ PokegearClock_Joypad: ; 90f3e (24:4f3e)
and D_RIGHT
ret z
ld a, [wPokegearFlags]
- bit 0, a ; ENGINE_MAP_CARD
+ bit POKEGEAR_MAP_CARD_F, a
jr z, .no_map_card
ld c, POKEGEARSTATE_MAPCHECKREGION
ld b, POKEGEARCARD_MAP
@@ -504,7 +504,7 @@ PokegearClock_Joypad: ; 90f3e (24:4f3e)
.no_map_card
ld a, [wPokegearFlags]
- bit 2, a ; ENGINE_PHONE_CARD
+ bit POKEGEAR_PHONE_CARD_F, a
jr z, .no_phone_card
ld c, POKEGEARSTATE_PHONEINIT
ld b, POKEGEARCARD_PHONE
@@ -512,7 +512,7 @@ PokegearClock_Joypad: ; 90f3e (24:4f3e)
.no_phone_card
ld a, [wPokegearFlags]
- bit 1, a ; ENGINE_RADIO_CARD
+ bit POKEGEAR_RADIO_CARD_F, a
ret z
ld c, POKEGEARSTATE_RADIOINIT
ld b, POKEGEARCARD_RADIO
@@ -613,7 +613,7 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
.right
ld a, [wPokegearFlags]
- bit 2, a ; ENGINE_PHONE_CARD
+ bit POKEGEAR_PHONE_CARD_F, a
jr z, .no_phone
ld c, POKEGEARSTATE_PHONEINIT
ld b, POKEGEARCARD_PHONE
@@ -621,7 +621,7 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
.no_phone
ld a, [wPokegearFlags]
- bit 1, a ; ENGINE_RADIO_CARD
+ bit POKEGEAR_RADIO_CARD_F, a
ret z
ld c, POKEGEARSTATE_RADIOINIT
ld b, POKEGEARCARD_RADIO
@@ -687,7 +687,7 @@ PokegearMap_InitPlayerIcon: ; 9106a
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK
ld a, [wPlayerGender]
- bit 0, a ; ENGINE_PLAYER_IS_FEMALE
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK
.got_gender
@@ -764,7 +764,7 @@ PokegearMap_UpdateCursorPosition: ; 910d4
TownMap_GetKantoLandmarkLimits: ; 910e8
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
jr z, .not_hof
ld d, ROUTE_28
ld e, PALLET_TOWN
@@ -810,7 +810,7 @@ PokegearRadio_Joypad: ; 91112 (24:5112)
.left
ld a, [wPokegearFlags]
- bit 2, a ; ENGINE_PHONE_CARD
+ bit POKEGEAR_PHONE_CARD_F, a
jr z, .no_phone
ld c, POKEGEARSTATE_PHONEINIT
ld b, POKEGEARCARD_PHONE
@@ -818,7 +818,7 @@ PokegearRadio_Joypad: ; 91112 (24:5112)
.no_phone
ld a, [wPokegearFlags]
- bit 0, a ; ENGINE_MAP_CARD
+ bit POKEGEAR_MAP_CARD_F, a
jr z, .no_map
ld c, POKEGEARSTATE_MAPCHECKREGION
ld b, POKEGEARCARD_MAP
@@ -869,7 +869,7 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
.left
ld a, [wPokegearFlags]
- bit 0, a ; ENGINE_MAP_CARD
+ bit POKEGEAR_MAP_CARD_F, a
jr z, .no_map
ld c, POKEGEARSTATE_MAPCHECKREGION
ld b, POKEGEARCARD_MAP
@@ -882,7 +882,7 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
.right
ld a, [wPokegearFlags]
- bit 1, a ; ENGINE_RADIO_CARD
+ bit POKEGEAR_RADIO_CARD_F, a
ret z
ld c, POKEGEARSTATE_RADIOINIT
ld b, POKEGEARCARD_RADIO
@@ -1590,7 +1590,7 @@ RadioChannels:
call .InJohto
jr c, .NoSignal
ld a, [wPokegearFlags]
- bit 3, a ; ENGINE_EXPN_CARD
+ bit POKEGEAR_EXPN_CARD_F, a
jr z, .NoSignal
jp LoadStation_PlacesAndPeople
@@ -1598,7 +1598,7 @@ RadioChannels:
call .InJohto
jr c, .NoSignal
ld a, [wPokegearFlags]
- bit 3, a ; ENGINE_EXPN_CARD
+ bit POKEGEAR_EXPN_CARD_F, a
jr z, .NoSignal
jp LoadStation_LetsAllSing
@@ -1606,14 +1606,14 @@ RadioChannels:
call .InJohto
jr c, .NoSignal
ld a, [wPokegearFlags]
- bit 3, a ; ENGINE_EXPN_CARD
+ bit POKEGEAR_EXPN_CARD_F, a
jr z, .NoSignal
jp LoadStation_PokeFluteRadio
.EvolutionRadio:
; This station airs in the Lake of Rage area when Rocket are still in Mahogany.
ld a, [wStatusFlags]
- bit 4, a ; ENGINE_ROCKET_SIGNAL_ON_CH20
+ bit STATUSFLAGS_ROCKET_SIGNAL_F, a
jr z, .NoSignal
ld a, [wPokegearMapPlayerIconLandmark]
cp MAHOGANY_TOWN
@@ -1699,7 +1699,7 @@ LoadStation_BuenasPassword: ; 917a5 (24:57a5)
call Radio_BackUpFarCallParams
ld de, NotBuenasPasswordName
ld a, [wStatusFlags2]
- bit 0, a ; ENGINE_ROCKETS_IN_RADIO_TOWER
+ bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
ret z
ld de, BuenasPasswordName
ret
@@ -2561,7 +2561,7 @@ Pokedex_GetArea: ; 91d11
.right
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
ret z
ld a, [hWY]
and a
@@ -2690,7 +2690,7 @@ Pokedex_GetArea: ; 91d11
push bc
ld c, PAL_OW_RED
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .male
inc c ; PAL_OW_BLUE
.male
@@ -2917,7 +2917,7 @@ TownMapPlayerIcon: ; 91fa6
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male
ld a, [wPlayerGender]
- bit 0, a
+ bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female
.got_gender
diff --git a/engine/radio.asm b/engine/radio.asm
index e6ee257ee..5277b12cd 100644
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -5,7 +5,7 @@ PlayRadioShow:
jr nc, .ok
; If Team Rocket is not occupying the radio tower, we don't need to be here.
ld a, [wStatusFlags2]
- bit 0, a ; checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
jr z, .ok
; If we're in Kanto, we don't need to be here.
call IsInJohto
@@ -205,7 +205,7 @@ OaksPkmnTalk4:
.sample
call Random
and %11111
- cp (OaksPkmnTalkRoutesEnd - OaksPkmnTalkRoutes) / 2
+ cp (OaksPkmnTalkRoutes.End - OaksPkmnTalkRoutes) / 2
jr nc, .sample
; We now have a number between 0 and 14.
ld hl, OaksPkmnTalkRoutes
@@ -972,9 +972,9 @@ BenFernText3B:
LuckyNumberShow1:
call StartRadioStation
- callfar Special_CheckLuckyNumberShowFlag
+ callfar CheckLuckyNumberShowFlag
jr nc, .dontreset
- callfar Special_ResetLuckyNumberShowFlag
+ callfar ResetLuckyNumberShowFlag
.dontreset
ld hl, LC_Text1
ld a, LUCKY_NUMBER_SHOW_2
@@ -1171,7 +1171,7 @@ PeoplePlaces4: ; People
push af
ld hl, PnP_HiddenPeople
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
jr z, .ok
ld hl, PnP_HiddenPeople_BeatE4
ld a, [wKantoBadges]
@@ -1330,7 +1330,7 @@ PnP_odd:
PeoplePlaces6: ; Places
call Random
- cp (PnP_HiddenPlacesEnd - PnP_HiddenPlaces) / 2
+ cp (PnP_HiddenPlaces.End - PnP_HiddenPlaces) / 2
jr nc, PeoplePlaces6
ld hl, PnP_HiddenPlaces
ld c, a
@@ -1560,7 +1560,7 @@ BuenasPassword4:
ld a, [wBuenasPassword]
; If we already generated the password today, we don't need to generate a new one.
ld hl, wWeeklyFlags
- bit 7, [hl] ; ENGINE_BUENAS_PASSWORD
+ bit WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
jr nz, .AlreadyGotIt
; There are only 11 groups to choose from.
.greater_than_11
@@ -1582,7 +1582,7 @@ BuenasPassword4:
ld [wBuenasPassword], a
; Set the flag so that we don't generate a new password this week.
ld hl, wWeeklyFlags
- set 7, [hl] ; ENGINE_BUENAS_PASSWORD
+ set WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
.AlreadyGotIt:
ld c, a
call GetBuenasPassword
@@ -1703,14 +1703,14 @@ BuenasPassword7:
BuenasPasswordAfterMidnight:
push hl
ld hl, wWeeklyFlags
- res 7, [hl] ; ENGINE_BUENAS_PASSWORD
+ res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
pop hl
ld a, BUENAS_PASSWORD_8
jp NextRadioLine
BuenasPassword8:
ld hl, wWeeklyFlags
- res 7, [hl] ; ENGINE_BUENAS_PASSWORD
+ res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
ld hl, BuenaRadioMidnightText10
ld a, BUENAS_PASSWORD_9
jp NextRadioLine
@@ -1778,7 +1778,7 @@ BuenasPassword20:
pop af
ld [hBGMapMode], a
ld hl, wWeeklyFlags
- res 7, [hl]
+ res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
ld a, BUENAS_PASSWORD
ld [wCurrentRadioLine], a
xor a
diff --git a/engine/routines/playslowcry.asm b/engine/routines/playslowcry.asm
index 1dc6c78ac..1f27a7ca4 100644
--- a/engine/routines/playslowcry.asm
+++ b/engine/routines/playslowcry.asm
@@ -1,4 +1,4 @@
-Special_PlaySlowCry: ; fb841
+PlaySlowCry: ; fb841
ld a, [wScriptVar]
call LoadCry
jr c, .done
diff --git a/engine/routines/sine.asm b/engine/routines/sine.asm
index 5f56a10a8..8c5ec6347 100755
--- a/engine/routines/sine.asm
+++ b/engine/routines/sine.asm
@@ -45,4 +45,4 @@ _Sine:: ; 84d9
.sinewave ; 850b
; A $20-word table representing a sine wave.
; 90 degrees is index $10 at a base amplitude of $100.
- sine_wave $100
+ sine_wave 32
diff --git a/engine/routines/unreferenced_getgen1trainerclassname.asm b/engine/routines/unreferenced_getgen1trainerclassname.asm
index 66c80172d..da8e98b61 100644
--- a/engine/routines/unreferenced_getgen1trainerclassname.asm
+++ b/engine/routines/unreferenced_getgen1trainerclassname.asm
@@ -18,4 +18,4 @@ Unreferenced_GetGen1TrainerClassName: ; 50a28
jr nz, .copy
ret
-INCLUDE "data/unused/gen_1_trainer_names.asm"
+INCLUDE "data/text/unused_gen1_trainer_names.asm"
diff --git a/engine/save.asm b/engine/save.asm
index c519e50ad..073417699 100644
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -1,5 +1,5 @@
SaveMenu: ; 14a1a
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
farcall DisplaySaveInfoOnSave
call SpeechTextBox
call UpdateSprites
diff --git a/engine/scripting.asm b/engine/scripting.asm
index dd2cfffe8..f1c7ef7b0 100644
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -71,12 +71,12 @@ ScriptCommandTable:
dw Script_jump ; 03
dw Script_farjump ; 04
dw Script_ptjump ; 05
- dw Script_if_equal ; 06
- dw Script_if_not_equal ; 07
+ dw Script_ifequal ; 06
+ dw Script_ifnotequal ; 07
dw Script_iffalse ; 08
dw Script_iftrue ; 09
- dw Script_if_greater_than ; 0a
- dw Script_if_less_than ; 0b
+ dw Script_ifgreater ; 0a
+ dw Script_ifless ; 0b
dw Script_jumpstd ; 0c
dw Script_callstd ; 0d
dw Script_callasm ; 0e
@@ -136,7 +136,7 @@ ScriptCommandTable:
dw Script_stringtotext ; 44
dw Script_itemnotify ; 45
dw Script_pocketisfull ; 46
- dw Script_textbox ; 47
+ dw Script_opentext ; 47
dw Script_refreshscreen ; 48
dw Script_closetext ; 49
dw Script_loadbytec2cf ; 4a
@@ -144,7 +144,7 @@ ScriptCommandTable:
dw Script_writetext ; 4c
dw Script_repeattext ; 4d
dw Script_yesorno ; 4e
- dw Script_loadmenudata ; 4f
+ dw Script_loadmenuheader ; 4f
dw Script_closewindow ; 50
dw Script_jumptextfaceplayer ; 51
if _CRYSTAL
@@ -169,8 +169,8 @@ endc
dw Script_trainerflagaction ; 63
dw Script_winlosstext ; 64
dw Script_scripttalkafter ; 65
- dw Script_end_if_just_battled ; 66
- dw Script_check_just_battled ; 67
+ dw Script_endifjustbattled ; 66
+ dw Script_checkjustbattled ; 67
dw Script_setlasttalked ; 68
dw Script_applymovement ; 69
dw Script_applymovement2 ; 6a
@@ -185,7 +185,7 @@ endc
dw Script_writeobjectxy ; 73
dw Script_loademote ; 74
dw Script_showemote ; 75
- dw Script_spriteface ; 76
+ dw Script_objectface ; 76
dw Script_follownotexact ; 77
dw Script_earthquake ; 78
dw Script_changemap ; 79
@@ -214,7 +214,7 @@ endc
dw Script_return ; 90
dw Script_end ; 91
dw Script_reloadandreturn ; 92
- dw Script_end_all ; 93
+ dw Script_endall ; 93
dw Script_pokemart ; 94
dw Script_elevator ; 95
dw Script_trade ; 96
@@ -236,7 +236,7 @@ endc
dw Script_trainerclassname ; a6
dw Script_name ; a7
dw Script_wait ; a8
- dw Script_check_save ; a9
+ dw Script_checksave ; a9
StartScript:
ld hl, wScriptFlags
@@ -432,15 +432,15 @@ Script_yesorno:
ld [wScriptVar], a
ret
-Script_loadmenudata:
+Script_loadmenuheader:
; script command 0x4f
-; parameters: data
+; parameters: menu_header
call GetScriptByte
ld l, a
call GetScriptByte
ld h, a
- ld de, LoadMenuDataHeader
+ ld de, LoadMenuHeader
ld a, [wScriptBank]
call Call_a_de
call UpdateSprites
@@ -839,7 +839,7 @@ Script_winlosstext:
ld [hli], a
ret
-Script_end_if_just_battled:
+Script_endifjustbattled:
; script command 0x66
ld a, [wRunningTrainerBattleScript]
@@ -847,7 +847,7 @@ Script_end_if_just_battled:
ret z
jp Script_end
-Script_check_just_battled:
+Script_checkjustbattled:
; script command 0x67
ld a, TRUE
@@ -1052,7 +1052,7 @@ Script_faceobject:
call ApplyObjectFacing
ret
-Script_spriteface:
+Script_objectface:
; script command 0x76
; parameters: object_id, facing
@@ -1294,7 +1294,7 @@ Script_earthquake:
ld hl, EarthquakeMovement
ld de, wEarthquakeMovementDataBuffer
- ld bc, EarthquakeMovementEnd - EarthquakeMovement
+ ld bc, EarthquakeMovement.End - EarthquakeMovement
call CopyBytes
call GetScriptByte
ld [wEarthquakeMovementDataBuffer + 1], a
@@ -1312,7 +1312,7 @@ EarthquakeMovement:
step_shake 16 ; the 16 gets overwritten with the script byte
step_sleep 16 ; the 16 gets overwritten with the lower 6 bits of the script byte
step_end
-EarthquakeMovementEnd
+.End
Script_loadpikachudata:
@@ -1561,7 +1561,7 @@ Script_iftrue:
jp nz, Script_jump
jp SkipTwoScriptBytes
-Script_if_equal:
+Script_ifequal:
; script command 0x6
; parameters: byte, pointer
@@ -1571,7 +1571,7 @@ Script_if_equal:
jr z, Script_jump
jr SkipTwoScriptBytes
-Script_if_not_equal:
+Script_ifnotequal:
; script command 0x7
; parameters: byte, pointer
@@ -1581,7 +1581,7 @@ Script_if_not_equal:
jr nz, Script_jump
jr SkipTwoScriptBytes
-Script_if_greater_than:
+Script_ifgreater:
; script command 0xa
; parameters: byte, pointer
@@ -1592,7 +1592,7 @@ Script_if_greater_than:
jr c, Script_jump
jr SkipTwoScriptBytes
-Script_if_less_than:
+Script_ifless:
; script command 0xb
; parameters: byte, pointer
@@ -2449,14 +2449,14 @@ Script_wildoff:
; script command 0x38
ld hl, wStatusFlags
- set 5, [hl]
+ set STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
ret
Script_wildon:
; script command 0x37
ld hl, wStatusFlags
- res 5, [hl]
+ res STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
ret
Script_xycompare:
@@ -2477,7 +2477,7 @@ Script_warpfacing:
maskbits NUM_DIRECTIONS
ld c, a
ld a, [wPlayerSpriteSetupFlags]
- set 5, a
+ set PLAYERSPRITESETUP_CUSTOM_FACING_F, a
or c
ld [wPlayerSpriteSetupFlags], a
; fall through
@@ -2646,7 +2646,7 @@ Script_reloadandreturn:
call Script_newloadmap
jp Script_end
-Script_textbox:
+Script_opentext:
; script command 0x47
call OpenText
@@ -2787,7 +2787,7 @@ ExitScriptSubroutine:
scf
ret
-Script_end_all:
+Script_endall:
; script command 0x93
xor a
@@ -2804,12 +2804,12 @@ Script_halloffame:
; script command 0xa1
ld hl, wGameTimerPause
- res 0, [hl]
+ res GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
farcall StubbedTrainerRankings_HallOfFame
farcall StubbedTrainerRankings_HallOfFame2
farcall HallOfFame
ld hl, wGameTimerPause
- set 0, [hl]
+ set GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
jr ReturnFromCredits
Script_credits:
@@ -2817,7 +2817,7 @@ Script_credits:
farcall RedCredits
ReturnFromCredits:
- call Script_end_all
+ call Script_endall
ld a, $3
call LoadMapStatus
call StopScript
@@ -2839,7 +2839,7 @@ Script_wait:
pop bc
ret
-Script_check_save:
+Script_checksave:
; script command 0xa9
farcall CheckSave
diff --git a/engine/scrolling_menu.asm b/engine/scrolling_menu.asm
index e12d4254d..3be3d839c 100755
--- a/engine/scrolling_menu.asm
+++ b/engine/scrolling_menu.asm
@@ -118,7 +118,7 @@ ScrollingMenuJoyAction: ; 24609
; 24673
.select ; 24673
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 7, a
jp z, xor_a_dec_a
ld a, [wMenuCursorY]
@@ -136,7 +136,7 @@ ScrollingMenuJoyAction: ; 24609
; 24695
.start ; 24695
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 6, a
jp z, xor_a_dec_a
ld a, START
@@ -148,7 +148,7 @@ ScrollingMenuJoyAction: ; 24609
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a_dec_a
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 3, a
jp z, xor_a_dec_a
ld a, D_LEFT
@@ -160,7 +160,7 @@ ScrollingMenuJoyAction: ; 24609
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a_dec_a
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 2, a
jp z, xor_a_dec_a
ld a, D_RIGHT
@@ -188,7 +188,7 @@ ScrollingMenuJoyAction: ; 24609
bit 7, [hl]
jp z, xor_a
ld hl, wMenuScrollPosition
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
add [hl]
ld b, a
ld a, [wScrollingMenuListSize]
@@ -215,7 +215,7 @@ ScrollingMenu_ClearLeftColumn: ; 24706 (9:4706)
ld de, SCREEN_WIDTH
add hl, de
ld de, 2 * SCREEN_WIDTH
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
.loop
ld [hl], " "
add hl, de
@@ -224,14 +224,14 @@ ScrollingMenu_ClearLeftColumn: ; 24706 (9:4706)
ret
InitScrollingMenuCursor: ; 2471a
- ld hl, wMenuData2_ItemsPointerAddr
+ ld hl, wMenuData_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [wMenuData2_ItemsPointerBank]
+ ld a, [wMenuData_ItemsPointerBank]
call GetFarByte
ld [wScrollingMenuListSize], a
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
ld c, a
ld a, [wMenuScrollPosition]
add c
@@ -240,7 +240,7 @@ InitScrollingMenuCursor: ; 2471a
inc a
cp c
jr nc, .skip
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
ld c, a
ld a, [wScrollingMenuListSize]
inc a
@@ -274,7 +274,7 @@ InitScrollingMenuCursor: ; 2471a
; 24764
ScrollingMenu_InitFlags: ; 24764
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
ld c, a
ld a, [wScrollingMenuListSize]
ld b, a
@@ -284,7 +284,7 @@ ScrollingMenu_InitFlags: ; 24764
ld a, [wMenuBorderLeftCoord]
add 0
ld [w2DMenuCursorInitX], a
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
cp b
jr c, .no_extra_row
jr z, .no_extra_row
@@ -363,7 +363,7 @@ ScrollingMenu_ValidateSwitchItem: ; 247dd
ScrollingMenu_UpdateDisplay: ; 247f0
call ClearWholeMenuBox
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 4, a ; place arrows
jr z, .okay
ld a, [wMenuScrollPosition]
@@ -380,7 +380,7 @@ ScrollingMenu_UpdateDisplay: ; 247f0
call MenuBoxCoord2Tile
ld bc, SCREEN_WIDTH + 1
add hl, bc
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
ld b, a
ld c, $0
.loop
@@ -403,7 +403,7 @@ ScrollingMenu_UpdateDisplay: ; 247f0
ld a, c
cp b
jr nz, .loop
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 4, a ; place arrows
jr z, .done
ld a, [wMenuBorderBottomCoord]
@@ -417,7 +417,7 @@ ScrollingMenu_UpdateDisplay: ; 247f0
ret
.cancel
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 0, a ; call function on cancel
jr nz, .call_function
ld de, .string_2485f
@@ -430,7 +430,7 @@ ScrollingMenu_UpdateDisplay: ; 247f0
.call_function
ld d, h
ld e, l
- ld hl, wMenuData2_ScrollingMenuFunction1
+ ld hl, wMenuData_ScrollingMenuFunction1
jp CallPointerAt
; 2486e
@@ -438,10 +438,10 @@ ScrollingMenu_CallFunctions1and2: ; 2486e
push hl
ld d, h
ld e, l
- ld hl, wMenuData2_ScrollingMenuFunction1
+ ld hl, wMenuData_ScrollingMenuFunction1
call CallPointerAt
pop hl
- ld a, [wMenuData2_ScrollingMenuWidth]
+ ld a, [wMenuData_ScrollingMenuWidth]
and a
jr z, .done
ld e, a
@@ -449,7 +449,7 @@ ScrollingMenu_CallFunctions1and2: ; 2486e
add hl, de
ld d, h
ld e, l
- ld hl, wMenuData2_ScrollingMenuFunction2
+ ld hl, wMenuData_ScrollingMenuFunction2
call CallPointerAt
.done
@@ -465,7 +465,7 @@ ScrollingMenu_PlaceCursor: ; 2488b
cp b
jr nc, .done
ld c, a
- ld a, [wMenuData2_ScrollingMenuHeight]
+ ld a, [wMenuData_ScrollingMenuHeight]
add c
cp b
jr c, .done
@@ -489,7 +489,7 @@ ScrollingMenu_PlaceCursor: ; 2488b
; 248b8
ScrollingMenu_CheckCallFunction3: ; 248b8
- ld a, [wMenuData2Flags]
+ ld a, [wMenuDataFlags]
bit 5, a ; call function 3
ret z
bit 1, a ; call function 3 if not switching items
@@ -502,7 +502,7 @@ ScrollingMenu_CheckCallFunction3: ; 248b8
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
- ld hl, wMenuData2_ScrollingMenuFunction3
+ ld hl, wMenuData_ScrollingMenuFunction3
call CallPointerAt
ret
; 248d5
@@ -515,12 +515,12 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs: ; 248d5
add e
ld e, a
ld d, $0
- ld hl, wMenuData2_ItemsPointerAddr
+ ld hl, wMenuData_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
inc hl ; items
- ld a, [wMenuData2_ScrollingMenuSpacing]
+ ld a, [wMenuData_ScrollingMenuSpacing]
cp 1
jr z, .got_spacing
cp 2
@@ -529,12 +529,12 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs: ; 248d5
add hl, de
.got_spacing
add hl, de
- ld a, [wMenuData2_ItemsPointerBank]
+ ld a, [wMenuData_ItemsPointerBank]
call GetFarByte
ld [wMenuSelection], a
ld [wCurItem], a
inc hl
- ld a, [wMenuData2_ItemsPointerBank]
+ ld a, [wMenuData_ItemsPointerBank]
call GetFarByte
ld [wMenuSelectionQuantity], a
pop hl
diff --git a/engine/search.asm b/engine/search.asm
index 6c18f3e3d..57b489a37 100755
--- a/engine/search.asm
+++ b/engine/search.asm
@@ -1,4 +1,4 @@
-Special_BeastsCheck: ; 0x4a6e8
+BeastsCheck: ; 0x4a6e8
; Check if the player owns all three legendary beasts.
; They must exist in either party or PC, and have the player's OT and ID.
; Return the result in wScriptVar.
@@ -29,8 +29,8 @@ Special_BeastsCheck: ; 0x4a6e8
ret
-Special_MonCheck: ; 0x4a711
-; Check if the player owns any monsters of the species in wScriptVar.
+MonCheck: ; 0x4a711
+; Check if the player owns any Pokémon of the species in wScriptVar.
; Return the result in wScriptVar.
call CheckOwnMonAnywhere
@@ -219,7 +219,7 @@ CheckOwnMon: ; 0x4a7ba
ld hl, wPlayerName
-rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
+rept NAME_LENGTH_JAPANESE + -2 ; should be PLAYER_NAME_LENGTH + -2
ld a, [de]
cp [hl]
jr nz, .notfound
diff --git a/engine/search2.asm b/engine/search2.asm
index 15b8ae138..c43555080 100755
--- a/engine/search2.asm
+++ b/engine/search2.asm
@@ -1,18 +1,18 @@
-_FindGreaterThanThatLevel: ; 4dbd2
+_FindPartyMonGreaterThanThatLevel: ; 4dbd2
ld hl, wPartyMon1Level
call FindGreaterThanThatLevel
ret
-_FindAtLeastThatHappy: ; 4dbd9
+_FindPartyMonAtLeastThatHappy: ; 4dbd9
ld hl, wPartyMon1Happiness
call FindAtLeastThatHappy
ret
-_FindThatSpecies: ; 4dbe0
+_FindPartyMonThatSpecies: ; 4dbe0
ld hl, wPartyMon1Species
jp FindThatSpecies
-_FindThatSpeciesYourTrainerID: ; 4dbe6
+_FindPartyMonThatSpeciesYourTrainerID: ; 4dbe6
ld hl, wPartyMon1Species
call FindThatSpecies
ret z
diff --git a/engine/select_menu.asm b/engine/select_menu.asm
index 2135cd5bf..9898afda2 100755
--- a/engine/select_menu.asm
+++ b/engine/select_menu.asm
@@ -33,6 +33,7 @@ CheckRegisteredItem: ; 13345
ret
.Pockets:
+; entries correspond to *_POCKET constants
dw .CheckItem
dw .CheckBall
dw .CheckKeyItem
@@ -127,6 +128,7 @@ UseRegisteredItem: ; 133c3
ret
.SwitchTo:
+; entries correspond to ITEMMENU_* constants
dw .CantUse
dw .NoFunction
dw .NoFunction
diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm
index fe9ea52d9..924c78924 100755
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -267,7 +267,7 @@ Unreferenced_Function9282c: ; 9282c
ld a, [hl]
xor %00100000
ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
dec c
@@ -1809,8 +1809,8 @@ Slots_AskBet: ; 9307c (24:707c)
.loop
ld hl, .Text_BetHowManyCoins
call PrintText
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call VerticalMenu
call CloseWindow
ret c
@@ -1867,14 +1867,14 @@ Slots_AskBet: ; 9307c (24:707c)
db "@"
; 0x930d6
-.MenuDataHeader: ; 0x930d6
+.MenuHeader: ; 0x930d6
db MENU_BACKUP_TILES ; flags
menu_coords 14, 10, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x930de
-.MenuData2: ; 0x930de
+.MenuData: ; 0x930de
db STATICMENU_CURSOR ; flags
db 3 ; items
db " 3@"
diff --git a/engine/specials.asm b/engine/specials.asm
index facb1eb25..3904f4a31 100644
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -20,14 +20,14 @@ DummySpecial_c224: ; c224
ret
; c225
-Special_SetPlayerPalette: ; c225
+SetPlayerPalette: ; c225
ld a, [wScriptVar]
ld d, a
- farcall SetPlayerPalette
+ farcall _SetPlayerPalette
ret
; c230
-Special_GameCornerPrizeMonCheckDex: ; c230
+GameCornerPrizeMonCheckDex: ; c230
ld a, [wScriptVar]
dec a
call CheckCaughtMon
@@ -43,38 +43,38 @@ Special_GameCornerPrizeMonCheckDex: ; c230
ret
; c252
-UnusedSpecial_SeenMon: ; c252
+UnusedSetSeenMon: ; c252
ld a, [wScriptVar]
dec a
call SetSeenMon
ret
; c25a
-Special_FindGreaterThanThatLevel: ; c25a
+FindPartyMonGreaterThanThatLevel: ; c25a
ld a, [wScriptVar]
ld b, a
- farcall _FindGreaterThanThatLevel
+ farcall _FindPartyMonGreaterThanThatLevel
jr z, FoundNone
jr FoundOne
-Special_FindAtLeastThatHappy: ; c268
+FindPartyMonAtLeastThatHappy: ; c268
ld a, [wScriptVar]
ld b, a
- farcall _FindAtLeastThatHappy
+ farcall _FindPartyMonAtLeastThatHappy
jr z, FoundNone
jr FoundOne
-Special_FindThatSpecies: ; c276
+FindPartyMonThatSpecies: ; c276
ld a, [wScriptVar]
ld b, a
- farcall _FindThatSpecies
+ farcall _FindPartyMonThatSpecies
jr z, FoundNone
jr FoundOne
-Special_FindThatSpeciesYourTrainerID: ; c284
+FindPartyMonThatSpeciesYourTrainerID: ; c284
ld a, [wScriptVar]
ld b, a
- farcall _FindThatSpeciesYourTrainerID
+ farcall _FindPartyMonThatSpeciesYourTrainerID
jr z, FoundNone
jr FoundOne
@@ -89,7 +89,7 @@ FoundNone: ; c298
ret
; c29d
-Special_NameRival: ; 0xc29d
+NameRival: ; 0xc29d
ld b, $2 ; rival
ld de, wRivalName
farcall _NamingScreen
@@ -103,42 +103,42 @@ Special_NameRival: ; 0xc29d
DefaultRivalName: ; 0xc2b2
db "SILVER@"
-Special_NameRater: ; c2b9
- farcall NameRater
+NameRater: ; c2b9
+ farcall _NameRater
ret
; c2c0
-Special_TownMap: ; c2c0
+OverworldTownMap: ; c2c0
call FadeToMenu
farcall _TownMap
call ExitAllMenus
ret
; c2cd
-Special_UnownPrinter: ; c2cd
+UnownPrinter: ; c2cd
call FadeToMenu
- farcall UnownPrinter
+ farcall _UnownPrinter
call ExitAllMenus
ret
; c2da
-Special_DisplayLinkRecord: ; c2da
+DisplayLinkRecord: ; c2da
call FadeToMenu
- farcall DisplayLinkRecord
+ farcall _DisplayLinkRecord
call ExitAllMenus
ret
; c2e7
-Special_KrissHousePC: ; c2e7
+PlayersHousePC: ; c2e7
xor a
ld [wScriptVar], a
- farcall _KrissHousePC
+ farcall _PlayersHousePC
ld a, c
ld [wScriptVar], a
ret
; c2f6
-Special_CheckMysteryGift: ; c2f6
+CheckMysteryGift: ; c2f6
ld a, BANK(sMysteryGiftItem)
call GetSRAMBank
ld a, [sMysteryGiftItem]
@@ -152,7 +152,7 @@ Special_CheckMysteryGift: ; c2f6
ret
; c309
-Special_GetMysteryGiftItem: ; c309
+GetMysteryGiftItem: ; c309
ld a, BANK(sMysteryGiftItem)
call GetSRAMBank
ld a, [sMysteryGiftItem]
@@ -187,57 +187,57 @@ Special_GetMysteryGiftItem: ; c309
db "@"
; 0xc34a
-Special_BugContestJudging: ; c34a
+BugContestJudging: ; c34a
farcall _BugContestJudging
ld a, b
ld [wScriptVar], a
ret
; c355
-Special_MapRadio: ; c355
+MapRadio: ; c355
ld a, [wScriptVar]
ld e, a
farcall PlayRadio
ret
; c360
-Special_UnownPuzzle: ; c360
+UnownPuzzle: ; c360
call FadeToMenu
- farcall UnownPuzzle
+ farcall _UnownPuzzle
ld a, [wSolvedUnownPuzzle]
ld [wScriptVar], a
call ExitAllMenus
ret
; c373
-Special_SlotMachine: ; c373
- call Special_CheckCoins
+SlotMachine: ; c373
+ call CheckCoinsAndCoinCase
ret c
ld a, BANK(_SlotMachine)
ld hl, _SlotMachine
- call Special_StartGameCornerGame
+ call StartGameCornerGame
ret
; c380
-Special_CardFlip: ; c380
- call Special_CheckCoins
+CardFlip: ; c380
+ call CheckCoinsAndCoinCase
ret c
ld a, BANK(_CardFlip)
ld hl, _CardFlip
- call Special_StartGameCornerGame
+ call StartGameCornerGame
ret
; c38d
-Special_DummyNonfunctionalGameCornerGame: ; c38d
- call Special_CheckCoins
+DummyNonfunctionalGameCornerGame: ; c38d
+ call CheckCoinsAndCoinCase
ret c
ld a, BANK(_DummyGame)
ld hl, _DummyGame
- call Special_StartGameCornerGame
+ call StartGameCornerGame
ret
; c39a
-Special_StartGameCornerGame: ; c39a
+StartGameCornerGame: ; c39a
call FarQueueScript
call FadeToMenu
ld hl, wQueuedScriptBank
@@ -252,7 +252,7 @@ Special_StartGameCornerGame: ; c39a
ret
; c3ae
-Special_CheckCoins: ; c3ae
+CheckCoinsAndCoinCase: ; c3ae
ld hl, wCoins
ld a, [hli]
or [hl]
@@ -290,7 +290,7 @@ Special_CheckCoins: ; c3ae
db "@"
; 0xc3db
-Special_ClearBGPalettesBufferScreen: ; c3db
+ClearBGPalettesBufferScreen: ; c3db
call ClearBGPalettes
call BufferScreen
ret
@@ -307,14 +307,14 @@ ScriptReturnCarry: ; c3e2
ret
; c3ef
-UnusedSpecial_CheckUnusedTwoDayTimer: ; c3ef
+UnusedCheckUnusedTwoDayTimer: ; c3ef
farcall CheckUnusedTwoDayTimer
ld a, [wUnusedTwoDayTimer]
ld [wScriptVar], a
ret
; c3fc
-Special_ActivateFishingSwarm: ; c3fc
+ActivateFishingSwarm: ; c3fc
ld a, [wScriptVar]
ld [wFishingSwarmFlag], a
ret
@@ -341,26 +341,26 @@ StoreSwarmMapIndices:: ; c403
; c419
-Special_CheckPokerus: ; c419
+CheckPokerus: ; c419
; Check if a monster in your party has Pokerus
- farcall CheckPokerus
+ farcall _CheckPokerus
jp ScriptReturnCarry
; c422
-Special_ResetLuckyNumberShowFlag: ; c422
+ResetLuckyNumberShowFlag: ; c422
farcall RestartLuckyNumberCountdown
ld hl, wLuckyNumberShowFlag
- res 0, [hl]
+ res LUCKYNUMBERSHOW_GAME_OVER_F, [hl]
farcall LoadOrRegenerateLuckyIDNumber
ret
; c434
-Special_CheckLuckyNumberShowFlag: ; c434
- farcall CheckLuckyNumberShowFlag
+CheckLuckyNumberShowFlag: ; c434
+ farcall _CheckLuckyNumberShowFlag
jp ScriptReturnCarry
; c43d
-Special_SnorlaxAwake: ; 0xc43d
+SnorlaxAwake: ; 0xc43d
; Check if the Poké Flute channel is playing, and if the player is standing
; next to Snorlax.
@@ -411,13 +411,13 @@ Special_SnorlaxAwake: ; 0xc43d
db -1
-Special_PlayCurMonCry: ; c472
+PlayCurMonCry: ; c472
ld a, [wCurPartySpecies]
jp PlayMonCry
; c478
-Special_GameboyCheck: ; c478
+GameboyCheck: ; c478
ld a, [hCGB]
and a
jr nz, .cgb
@@ -439,7 +439,7 @@ Special_GameboyCheck: ; c478
ret
-Special_FadeOutMusic: ; c48f
+FadeOutMusic: ; c48f
ld a, LOW(MUSIC_NONE)
ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
@@ -449,21 +449,21 @@ Special_FadeOutMusic: ; c48f
ret
; c49f
-Special_Diploma: ; c49f
+Diploma: ; c49f
call FadeToMenu
farcall _Diploma
call ExitAllMenus
ret
; c4ac
-Special_PrintDiploma: ; c4ac
+PrintDiploma: ; c4ac
call FadeToMenu
farcall _PrintDiploma
call ExitAllMenus
ret
; c4b9
-Special_TrainerHouse: ; 0xc4b9
+TrainerHouse: ; 0xc4b9
ld a, BANK(sMysteryGiftTrainerHouseFlag)
call GetSRAMBank
ld a, [sMysteryGiftTrainerHouseFlag]
diff --git a/engine/sprites.asm b/engine/sprites.asm
index 277b75124..e39fa615d 100755
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -559,16 +559,17 @@ INCLUDE "data/sprite_anims/framesets.asm"
INCLUDE "data/sprite_anims/oam.asm"
-BrokenStdGFXPointers: ; Broken 2bpp pointers
- dbbw $80, $01, .deleted ; 128-tile 2bpp at 1:672a (inside Multiply)
- dbbw $80, $01, .deleted
- dbbw $80, $01, .deleted
- dbbw $80, $01, .deleted
- dbbw $10, $37, .deleted ; 16-tile 2bpp at 37:672a (within TilesetTrainStationGFX)
- dbbw $10, $11, .deleted ; 16-tile 2bpp at 11:672a (empty data)
- dbbw $10, $39, .deleted ; 16-tile 2bpp at 39:672a (empty data)
- dbbw $10, $24, .deleted ; 16-tile 2bpp at 24:672a (inside Function926f7)
- dbbw $10, $21, .deleted ; 16-tile 2bpp at 21:672a (inside Function8671c)
+BrokenStdGFXPointers:
+ ; tile count, bank, pointer
+ ; (all pointers were dummied out to .deleted)
+rept 4
+ dbbw 128, $01, .deleted
+endr
+ dbbw 16, $37, .deleted
+ dbbw 16, $11, .deleted
+ dbbw 16, $39, .deleted
+ dbbw 16, $24, .deleted
+ dbbw 16, $21, .deleted
.deleted
; 8e72a (23:672a)
@@ -619,7 +620,7 @@ Sprites_Sine: ; 8e72c
; 8e75d
.sinewave ; 8e75d
- sine_wave $100
+ sine_wave 32
AnimateEndOfExpBar: ; 8e79d
diff --git a/engine/start_menu.asm b/engine/start_menu.asm
index f0cacc5b1..644dc1804 100755
--- a/engine/start_menu.asm
+++ b/engine/start_menu.asm
@@ -1,3 +1,16 @@
+; StartMenu.Items indexes
+ const_def
+ const STARTMENUITEM_POKEDEX ; 0
+ const STARTMENUITEM_POKEMON ; 1
+ const STARTMENUITEM_PACK ; 2
+ const STARTMENUITEM_STATUS ; 3
+ const STARTMENUITEM_SAVE ; 4
+ const STARTMENUITEM_OPTION ; 5
+ const STARTMENUITEM_EXIT ; 6
+ const STARTMENUITEM_POKEGEAR ; 7
+ const STARTMENUITEM_QUIT ; 8
+
+
StartMenu:: ; 125cd
call ClearWindowData
@@ -8,13 +21,13 @@ StartMenu:: ; 125cd
farcall ReanchorBGMap_NoOAMUpdate
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
- ld hl, .MenuDataHeader
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
+ ld hl, .MenuHeader
jr z, .GotMenuData
- ld hl, .ContestMenuDataHeader
+ ld hl, .ContestMenuHeader
.GotMenuData:
- call LoadMenuDataHeader
+ call LoadMenuHeader
call .SetUpMenuItems
ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a
@@ -151,13 +164,13 @@ StartMenu:: ; 125cd
; 126d3
-.MenuDataHeader:
+.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 10, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw .MenuData
db 1 ; default selection
-.ContestMenuDataHeader:
+.ContestMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 10, 2, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw .MenuData
@@ -171,6 +184,7 @@ StartMenu:: ; 125cd
dw .Items
.Items:
+; entries correspond to STARTMENUITEM_* constants
dw StartMenu_Pokedex, .PokedexString, .PokedexDesc
dw StartMenu_Pokemon, .PartyString, .PartyDesc
dw StartMenu_Pack, .PackString, .PackDesc
@@ -181,41 +195,50 @@ StartMenu:: ; 125cd
dw StartMenu_Pokegear, .PokegearString, .PokegearDesc
dw StartMenu_Quit, .QuitString, .QuitDesc
-.PokedexString: db "#DEX@"
-.PartyString: db "#MON@"
-.PackString: db "PACK@"
-.StatusString: db "<PLAYER>@"
-.SaveString: db "SAVE@"
-.OptionString: db "OPTION@"
-.ExitString: db "EXIT@"
-.PokegearString: db "<POKE>GEAR@"
-.QuitString: db "QUIT@"
-
-.PokedexDesc: db "#MON"
+.PokedexString: db "#DEX@"
+.PartyString: db "#MON@"
+.PackString: db "PACK@"
+.StatusString: db "<PLAYER>@"
+.SaveString: db "SAVE@"
+.OptionString: db "OPTION@"
+.ExitString: db "EXIT@"
+.PokegearString: db "<POKE>GEAR@"
+.QuitString: db "QUIT@"
+
+.PokedexDesc:
+ db "#MON"
next "database@"
-.PartyDesc: db "Party <PKMN>"
+.PartyDesc:
+ db "Party <PKMN>"
next "status@"
-.PackDesc: db "Contains"
+.PackDesc:
+ db "Contains"
next "items@"
-.PokegearDesc: db "Trainer's"
+.PokegearDesc:
+ db "Trainer's"
next "key device@"
-.StatusDesc: db "Your own"
+.StatusDesc:
+ db "Your own"
next "status@"
-.SaveDesc: db "Save your"
+.SaveDesc:
+ db "Save your"
next "progress@"
-.OptionDesc: db "Change"
+.OptionDesc:
+ db "Change"
next "settings@"
-.ExitDesc: db "Close this"
+.ExitDesc:
+ db "Close this"
next "menu@"
-.QuitDesc: db "Quit and"
+.QuitDesc:
+ db "Quit and"
next "be judged.@"
@@ -266,7 +289,7 @@ endr
.GetMenuAccountTextPointer: ; 12819
ld e, a
ld d, 0
- ld hl, wMenuData2PointerTableAddr
+ ld hl, wMenuDataPointerTableAddr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -283,16 +306,16 @@ endr
call .FillMenuList
ld hl, wStatusFlags
- bit 0, [hl]
+ bit STATUSFLAGS_POKEDEX_F, [hl]
jr z, .no_pokedex
- ld a, 0 ; pokedex
+ ld a, STARTMENUITEM_POKEDEX
call .AppendMenuList
.no_pokedex
ld a, [wPartyCount]
and a
jr z, .no_pokemon
- ld a, 1 ; pokemon
+ ld a, STARTMENUITEM_POKEMON
call .AppendMenuList
.no_pokemon
@@ -300,37 +323,37 @@ endr
and a
jr nz, .no_pack
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .no_pack
- ld a, 2 ; pack
+ ld a, STARTMENUITEM_PACK
call .AppendMenuList
.no_pack
ld hl, wPokegearFlags
- bit 7, [hl]
+ bit POKEGEAR_OBTAINED_F, [hl]
jr z, .no_pokegear
- ld a, 7 ; pokegear
+ ld a, STARTMENUITEM_POKEGEAR
call .AppendMenuList
.no_pokegear
- ld a, 3 ; status
+ ld a, STARTMENUITEM_STATUS
call .AppendMenuList
ld a, [wLinkMode]
and a
jr nz, .no_save
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
- ld a, 8 ; quit
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
+ ld a, STARTMENUITEM_QUIT
jr nz, .write
- ld a, 4 ; save
+ ld a, STARTMENUITEM_SAVE
.write
call .AppendMenuList
.no_save
- ld a, 5 ; option
+ ld a, STARTMENUITEM_OPTION
call .AppendMenuList
- ld a, 6 ; exit
+ ld a, STARTMENUITEM_EXIT
call .AppendMenuList
ld a, c
ld [wMenuItemsList], a
@@ -383,13 +406,13 @@ endr
.IsMenuAccountOn: ; 128cb
ld a, [wOptions2]
- and 1
+ and 1 << MENU_ACCOUNT
ret
; 128d1
.DrawBugContestStatusBox: ; 128d1
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ret z
farcall StartMenu_DrawBugContestStatusBox
ret
@@ -397,7 +420,7 @@ endr
.DrawBugContestStatus: ; 128de
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .contest
ret
.contest
@@ -706,26 +729,26 @@ PokemonActionSubmenu: ; 12a88
ret
.Actions:
- dbw MONMENU_CUT, MonMenu_Cut ; Cut
- dbw MONMENU_FLY, MonMenu_Fly ; Fly
- dbw MONMENU_SURF, MonMenu_Surf ; Surf
- dbw MONMENU_STRENGTH, MonMenu_Strength ; Strength
- dbw MONMENU_FLASH, MonMenu_Flash ; Flash
- dbw MONMENU_WHIRLPOOL, MonMenu_Whirlpool ; Whirlpool
- dbw MONMENU_DIG, MonMenu_Dig ; Dig
- dbw MONMENU_TELEPORT, MonMenu_Teleport ; Teleport
- dbw MONMENU_SOFTBOILED, MonMenu_Softboiled_MilkDrink ; Softboiled
- dbw MONMENU_MILKDRINK, MonMenu_Softboiled_MilkDrink ; MilkDrink
- dbw MONMENU_HEADBUTT, MonMenu_Headbutt ; Headbutt
- dbw MONMENU_WATERFALL, MonMenu_Waterfall ; Waterfall
- dbw MONMENU_ROCKSMASH, MonMenu_RockSmash ; RockSmash
- dbw MONMENU_SWEETSCENT, MonMenu_SweetScent ; SweetScent
- dbw MONMENU_STATS, OpenPartyStats
- dbw MONMENU_SWITCH, SwitchPartyMons
- dbw MONMENU_ITEM, GiveTakePartyMonItem
- dbw MONMENU_CANCEL, CancelPokemonAction
- dbw MONMENU_MOVE, ManagePokemonMoves ; move
- dbw MONMENU_MAIL, MonMailAction ; mail
+ dbw MONMENUITEM_CUT, MonMenu_Cut
+ dbw MONMENUITEM_FLY, MonMenu_Fly
+ dbw MONMENUITEM_SURF, MonMenu_Surf
+ dbw MONMENUITEM_STRENGTH, MonMenu_Strength
+ dbw MONMENUITEM_FLASH, MonMenu_Flash
+ dbw MONMENUITEM_WHIRLPOOL, MonMenu_Whirlpool
+ dbw MONMENUITEM_DIG, MonMenu_Dig
+ dbw MONMENUITEM_TELEPORT, MonMenu_Teleport
+ dbw MONMENUITEM_SOFTBOILED, MonMenu_Softboiled_MilkDrink
+ dbw MONMENUITEM_MILKDRINK, MonMenu_Softboiled_MilkDrink
+ dbw MONMENUITEM_HEADBUTT, MonMenu_Headbutt
+ dbw MONMENUITEM_WATERFALL, MonMenu_Waterfall
+ dbw MONMENUITEM_ROCKSMASH, MonMenu_RockSmash
+ dbw MONMENUITEM_SWEETSCENT, MonMenu_SweetScent
+ dbw MONMENUITEM_STATS, OpenPartyStats
+ dbw MONMENUITEM_SWITCH, SwitchPartyMons
+ dbw MONMENUITEM_ITEM, GiveTakePartyMonItem
+ dbw MONMENUITEM_CANCEL, CancelPokemonAction
+ dbw MONMENUITEM_MOVE, ManagePokemonMoves
+ dbw MONMENUITEM_MAIL, MonMailAction
; 12aec
@@ -749,7 +772,7 @@ SwitchPartyMons: ; 12aec
farcall PrintPartyMenuText
hlcoord 0, 1
- ld bc, 20 * 2
+ ld bc, SCREEN_WIDTH * 2
ld a, [wSwitchMon]
dec a
call AddNTimes
@@ -790,7 +813,7 @@ GiveTakePartyMonItem: ; 12b60
jr z, .cancel
ld hl, GiveTakeItemMenuData
- call LoadMenuDataHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
jr c, .cancel
@@ -804,7 +827,7 @@ GiveTakePartyMonItem: ; 12b60
cp 1
jr nz, .take
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearPalettes
call .GiveItem
call ClearPalettes
@@ -1038,7 +1061,7 @@ GetPartyItemLocation: ; 12cd7
ReceiveItemFromPokemon: ; 12cdf
- ld a, $1
+ ld a, 1
ld [wItemQuantityChangeBuffer], a
ld hl, wNumItems
jp ReceiveItem
@@ -1046,7 +1069,7 @@ ReceiveItemFromPokemon: ; 12cdf
GiveItemToPokemon: ; 12cea (4:6cea)
- ld a, $1
+ ld a, 1
ld [wItemQuantityChangeBuffer], a
ld hl, wNumItems
jp TossItem
@@ -1098,8 +1121,8 @@ MonMailAction: ; 12d45
jr z, .read
; Show the READ/TAKE/QUIT menu.
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
+ ld hl, .MenuHeader
+ call LoadMenuHeader
call VerticalMenu
call ExitMenu
@@ -1161,14 +1184,14 @@ MonMailAction: ; 12d45
; 12dc9
-.MenuDataHeader:
+.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 12, 10, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
- dw .MenuData2
+ dw .MenuData
db 1 ; default option
; 0x12dd1
-.MenuData2:
+.MenuData:
db STATICMENU_CURSOR ; flags
db 3 ; items
db "READ@"
@@ -1215,7 +1238,7 @@ MonMailAction: ; 12d45
OpenPartyStats: ; 12e00
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
call ClearSprites
; PartyMon
xor a
diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm
index e55c85c86..d4af8a8ac 100755
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -1,8 +1,8 @@
-const_value set 1
+ const_def 1
const PINK_PAGE ; 1
const GREEN_PAGE ; 2
const BLUE_PAGE ; 3
-NUM_STAT_PAGES EQU const_value +- 1
+NUM_STAT_PAGES EQU const_value + -1
BattleStatsScreenInit: ; 4dc7b (13:5c7b)
ld a, [wLinkMode]
diff --git a/engine/switch_items.asm b/engine/switch_items.asm
index b699d4719..77b635246 100755
--- a/engine/switch_items.asm
+++ b/engine/switch_items.asm
@@ -145,7 +145,7 @@ Function249d1: ; 249d1 (9:49d1)
inc hl
pop af
ld [hl], a
- ld hl, wMenuData2_ItemsPointerAddr
+ ld hl, wMenuData_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -199,7 +199,7 @@ Function24a4d: ; 24a4d (9:4a4d)
ItemSwitch_GetNthItem: ; 24a5c (9:4a5c)
push af
call ItemSwitch_ConvertSpacingToDW
- ld hl, wMenuData2_ItemsPointerAddr
+ ld hl, wMenuData_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -227,7 +227,7 @@ Function24a6c: ; 24a6c (9:4a6c)
ItemSwitch_ConvertSpacingToDW: ; 24a80 (9:4a80)
; This function is absolutely idiotic.
push hl
- ld a, [wMenuData2_ScrollingMenuSpacing]
+ ld a, [wMenuData_ScrollingMenuSpacing]
ld c, a
ld b, 0
ld hl, .spacing_dws
diff --git a/engine/tileset_anims.asm b/engine/tileset_anims.asm
index 9c32d7821..bf0037e65 100644
--- a/engine/tileset_anims.asm
+++ b/engine/tileset_anims.asm
@@ -502,7 +502,7 @@ ForestTreeLeftAnimation: ; fc45c
; Only during the Celebi event.
ld a, [wCelebiEvent]
- bit 2, a
+ bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc46c
ld hl, ForestTreeLeftFrames
jr .asm_fc47d
@@ -544,7 +544,7 @@ ForestTreeRightAnimation: ; fc4c4
; Only during the Celebi event.
ld a, [wCelebiEvent]
- bit 2, a
+ bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc4d4
ld hl, ForestTreeRightFrames
jr .asm_fc4eb
@@ -579,7 +579,7 @@ ForestTreeLeftAnimation2: ; fc4f2
; Only during the Celebi event.
ld a, [wCelebiEvent]
- bit 2, a
+ bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc502
ld hl, ForestTreeLeftFrames
jr .asm_fc515
@@ -611,7 +611,7 @@ ForestTreeRightAnimation2: ; fc51c
; Only during the Celebi event.
ld a, [wCelebiEvent]
- bit 2, a
+ bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc52c
ld hl, ForestTreeRightFrames
jr .asm_fc545
@@ -952,7 +952,7 @@ TileAnimationPalette: ; fc6d7
jr z, .color2
.color1
- ld hl, wBGPals1 palette PAL_BG_WATER + 2
+ ld hl, wBGPals1 palette PAL_BG_WATER color 1
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -960,7 +960,7 @@ TileAnimationPalette: ; fc6d7
jr .end
.color0
- ld hl, wBGPals1 palette PAL_BG_WATER
+ ld hl, wBGPals1 palette PAL_BG_WATER color 0
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -968,7 +968,7 @@ TileAnimationPalette: ; fc6d7
jr .end
.color2
- ld hl, wBGPals1 palette PAL_BG_WATER + 4
+ ld hl, wBGPals1 palette PAL_BG_WATER color 2
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -1009,7 +1009,7 @@ FlickeringCaveEntrancePalette: ; fc71e
jr .okay
.bit1set
- ld hl, wBGPals1 palette PAL_BG_YELLOW + 2
+ ld hl, wBGPals1 palette PAL_BG_YELLOW color 1
.okay
ld a, [hli]
diff --git a/engine/time.asm b/engine/time.asm
index 9013fd79f..0f83447cc 100755
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -102,10 +102,10 @@ CheckDailyResetTimer:: ; 11452
ret nc
xor a
ld hl, wDailyFlags
- ld [hli], a
- ld [hli], a
- ld [hli], a
- ld [hl], a
+ ld [hli], a ; wDailyFlags
+ ld [hli], a ; wWeeklyFlags
+ ld [hli], a ; wSwarmFlags
+ ld [hl], a ; wSwarmFlags + 1
ld hl, wDailyRematchFlags
rept 4
ld [hli], a
@@ -125,12 +125,12 @@ endr
dec [hl]
jr nz, .DontRestartKenjiBreakCountdown
.RestartKenjiBreakCountdown:
- call Special_SampleKenjiBreakCountdown
+ call SampleKenjiBreakCountdown
.DontRestartKenjiBreakCountdown:
jr RestartDailyResetTimer
; 11485
-Special_SampleKenjiBreakCountdown: ; 11485
+SampleKenjiBreakCountdown: ; 11485
; Generate a random number between 3 and 6
call Random
and %11
@@ -227,14 +227,14 @@ CheckUnusedTwoDayTimer: ; 1150c
; unused
ld hl, wDailyFlags
- set 2, [hl]
+ set DAILYFLAGS_FISH_SWARM_F, [hl]
ret
; 11522
; unused
and a
ld hl, wDailyFlags
- bit 2, [hl]
+ bit DAILYFLAGS_FISH_SWARM_F, [hl]
ret nz
scf
ret
@@ -261,7 +261,7 @@ RestartLuckyNumberCountdown: ; 1152b
ret
; 11542
-CheckLuckyNumberShowFlag: ; 11542
+_CheckLuckyNumberShowFlag: ; 11542
ld hl, wLuckyNumberDayBuffer
jp CheckDayDependentEventHL
; 11548
diff --git a/engine/time_capsule.asm b/engine/time_capsule.asm
index e366c1bbd..f90b7e249 100755
--- a/engine/time_capsule.asm
+++ b/engine/time_capsule.asm
@@ -144,4 +144,4 @@ PlaceTradePartnerNamesAndParty: ; fb60d
jr .loop
; fb656
-INCLUDE "data/pokemon/rby_base_special.asm"
+INCLUDE "data/pokemon/gen1_base_special.asm"
diff --git a/engine/time_capsule_2.asm b/engine/time_capsule_2.asm
index 0378ed697..a56e51785 100644
--- a/engine/time_capsule_2.asm
+++ b/engine/time_capsule_2.asm
@@ -36,4 +36,4 @@ ConvertMon_1to2: ; fb908
; fb91c
-INCLUDE "data/pokemon/rby_order.asm"
+INCLUDE "data/pokemon/gen1_order.asm"
diff --git a/engine/timeofdaypals.asm b/engine/timeofdaypals.asm
index 781c2e91a..b8d43d252 100644
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -119,7 +119,7 @@ _UpdateTimePals:: ; 8c070
ret
; 8c079
-Special_FadeInPalettes:: ; 8c079
+FadeInPalettes:: ; 8c079
ld c, $12
call GetTimePalFade
ld b, $4
@@ -127,7 +127,7 @@ Special_FadeInPalettes:: ; 8c079
ret
; 8c084
-Special_FadeOutPalettes:: ; 8c084
+FadeOutPalettes:: ; 8c084
call FillWhiteBGColor
ld c, $9
call GetTimePalFade
@@ -136,7 +136,7 @@ Special_FadeOutPalettes:: ; 8c084
ret
; 8c092
-Special_BattleTowerFade: ; 8c092
+BattleTowerFade: ; 8c092
call FillWhiteBGColor
ld c, $9
call GetTimePalFade
@@ -153,7 +153,7 @@ Special_BattleTowerFade: ; 8c092
ret
; 8c0ab
-Special_FadeInQuickly: ; 8c0ab
+FadeInQuickly: ; 8c0ab
ld c, $0
call GetTimePalFade
ld b, $4
@@ -161,7 +161,7 @@ Special_FadeInQuickly: ; 8c0ab
ret
; 8c0b6
-Special_FadeBlackQuickly: ; 8c0b6
+FadeBlackQuickly: ; 8c0b6
ld c, $9
call GetTimePalFade
ld b, $4
@@ -216,7 +216,7 @@ ReplaceTimeOfDayPals: ; 8c0e5
.DarkCave:
ld a, [wStatusFlags]
- bit 2, a ; Flash
+ bit STATUSFLAGS_FLASH_F, a
jr nz, .UsedFlash
ld a, %11111111 ; 3, 3, 3, 3
ld [wTimeOfDayPalset], a
diff --git a/engine/timeset.asm b/engine/timeset.asm
index 99e4e6843..eda3094e1 100755
--- a/engine/timeset.asm
+++ b/engine/timeset.asm
@@ -112,7 +112,7 @@ InitClock: ; 90672 (24:4672)
jr .HourIsSet
.MinutesAreSet:
- call SetTimeOfDay
+ call InitTimeOfDay
ld hl, OakText_ResponseToSetTime
call PrintText
call WaitPressAorB_BlinkCursor
@@ -407,7 +407,7 @@ TimeSetDownArrowGFX: ; 9090b
INCBIN "gfx/new_game/down_arrow.1bpp"
; 90913
-Special_SetDayOfWeek: ; 90913
+SetDayOfWeek: ; 90913
ld a, [hInMenu]
push af
ld a, $1
@@ -426,7 +426,7 @@ Special_SetDayOfWeek: ; 90913
hlcoord 0, 12
lb bc, 4, 18
call TextBox
- call LoadStandardMenuDataHeader
+ call LoadStandardMenuHeader
ld hl, .WhatDayIsItText
call PrintText
hlcoord 9, 3
@@ -454,7 +454,7 @@ Special_SetDayOfWeek: ; 90913
jr c, .loop
ld a, [wTempDayOfWeek]
ld [wStringBuffer2], a
- call SetDayOfWeek
+ call InitDayOfWeek
call LoadStandardFont
pop af
ld [hInMenu], a
@@ -573,7 +573,7 @@ Special_SetDayOfWeek: ; 90913
db "@"
; 0x90a54
-Special_InitialSetDSTFlag: ; 90a54
+InitialSetDSTFlag: ; 90a54
ld a, [wDST]
set 7, a
ld [wDST], a
@@ -604,7 +604,7 @@ Special_InitialSetDSTFlag: ; 90a54
db "@"
; 0x90a88
-Special_InitialClearDSTFlag: ; 90a88
+InitialClearDSTFlag: ; 90a88
ld a, [wDST]
res 7, a
ld [wDST], a
diff --git a/engine/title.asm b/engine/title.asm
index 310e4d164..f311f2342 100644
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -377,7 +377,7 @@ AnimateTitleCrystal: ; 10ef32
ld a, [hl]
add 2
ld [hli], a ; y
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
dec c
diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm
index cd6705e5c..e84c1c9f3 100755
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -290,7 +290,7 @@ TrainerCard_Page1_PrintDexCaught_GameTime: ; 2530a (9:530a)
ld de, .StatusTilemap
call TrainerCardSetup_PlaceTilemapString
ld a, [wStatusFlags]
- bit 0, a ; ENGINE_POKEDEX
+ bit STATUSFLAGS_POKEDEX_F, a
ret nz
hlcoord 1, 9
lb bc, 2, 17
diff --git a/engine/unown_puzzle.asm b/engine/unown_puzzle.asm
index dcad1ce20..83527ea69 100755
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -3,7 +3,7 @@ PUZZLE_VOID EQU $ef
puzcoord EQUS "* 6 +"
-UnownPuzzle: ; e1190
+_UnownPuzzle: ; e1190
ld a, [hInMenu]
push af
ld a, $1
diff --git a/engine/warp_connection.asm b/engine/warp_connection.asm
index 8d673de44..069b72234 100755
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -305,12 +305,12 @@ LoadGraphics: ; 1047cf
ld [hMapAnims], a
xor a
ld [hTileAnimFrame], a
- farcall Special_RefreshSprites
+ farcall RefreshSprites
call LoadFontsExtra
farcall LoadOverworldFont
ret
-Special_LoadMapPalettes: ; 1047eb
+LoadMapPalettes: ; 1047eb
ld b, SCGB_MAPPALS
jp GetSGBLayout
; 1047f0
@@ -322,7 +322,7 @@ RefreshMapSprites: ; 1047f0
farcall RefreshPlayerSprite
farcall CheckReplaceKrisSprite
ld hl, wPlayerSpriteSetupFlags
- bit 6, [hl]
+ bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
jr nz, .skip
ld hl, wVramState
set 0, [hl]
diff --git a/engine/wildmons.asm b/engine/wildmons.asm
index f578a4f84..154d84294 100755
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -429,7 +429,7 @@ _SwarmWildmonCheck
call CopyCurrMapDE
push hl
ld hl, wSwarmFlags
- bit 2, [hl]
+ bit SWARMFLAGS_DUNSPARCE_SWARM_F, [hl]
pop hl
jr z, .CheckYanma
ld a, [wDunsparceMapGroup]
@@ -446,7 +446,7 @@ _SwarmWildmonCheck
.CheckYanma:
push hl
ld hl, wSwarmFlags
- bit 3, [hl]
+ bit SWARMFLAGS_YANMA_SWARM_F, [hl]
pop hl
jr z, _NoSwarmWildmon
ld a, [wYanmaMapGroup]
@@ -508,7 +508,7 @@ LookUpWildmonsForMapDE: ; 2a288
; 2a2a0
-Special_InitRoamMons: ; 2a2a0
+InitRoamMons: ; 2a2a0
; initialize wRoamMon structs
; species
@@ -804,7 +804,7 @@ ValidateTempWildMonSpecies: ; 2a4a0
; Finds a rare wild Pokemon in the route of the trainer calling, then checks if it's been Seen already.
; The trainer will then tell you about the Pokemon if you haven't seen it.
-Special_RandomUnseenWildMon: ; 2a4ab
+RandomUnseenWildMon: ; 2a4ab
farcall GetCallerLocation
ld d, b
ld e, c
@@ -877,7 +877,7 @@ Special_RandomUnseenWildMon: ; 2a4ab
db "@"
; 0x2a51f
-Special_RandomPhoneWildMon: ; 2a51f
+RandomPhoneWildMon: ; 2a51f
farcall GetCallerLocation
ld d, b
ld e, c
@@ -917,7 +917,7 @@ Special_RandomPhoneWildMon: ; 2a51f
jp CopyBytes
; 2a567
-Special_RandomPhoneMon: ; 2a567
+RandomPhoneMon: ; 2a567
; Get a random monster owned by the trainer who's calling.
farcall GetCallerLocation
ld hl, TrainerGroups