summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-02-15 21:42:06 +0100
committerxCrystal <rgr.crystal@gmail.com>2018-02-15 21:43:24 +0100
commit1082494d9886e99f2eab1d924ec4091a1a902055 (patch)
tree30369cf4ba6ce45771b2a6009c48466851713cca /src/engine
parent24f40989d472407dc51653f2a671348126c6e816 (diff)
Style
Diffstat (limited to 'src/engine')
-rwxr-xr-xsrc/engine/bank1.asm182
-rwxr-xr-xsrc/engine/bank3.asm42
-rwxr-xr-xsrc/engine/bank5.asm12
-rw-r--r--src/engine/booster_packs.asm144
-rw-r--r--src/engine/effect_functions.asm24
-rwxr-xr-xsrc/engine/home.asm14
6 files changed, 209 insertions, 209 deletions
diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm
index b5894d2..2d9e6f9 100755
--- a/src/engine/bank1.asm
+++ b/src/engine/bank1.asm
@@ -86,7 +86,7 @@ StartDuel: ; 409f (1:409f)
ret c
; the loop returns here after every turn switch
-.mainDuelLoop ; 40ee (1:40ee)
+.main_duel_loop ; 40ee (1:40ee)
xor a
ld [wCurrentDuelMenuItem], a
call HandleSwordsDanceOrFocusEnergySubstatus
@@ -95,36 +95,36 @@ StartDuel: ; 409f (1:409f)
call Func_0f58
ld a, [wDuelFinished]
or a
- jr nz, .duelFinished
+ jr nz, .duel_finished
call UpdateSubstatusConditions
call $6baf
call Func_3b31
call Func_0f58
ld a, [wDuelFinished]
or a
- jr nz, .duelFinished
+ jr nz, .duel_finished
ld hl, $cc06
inc [hl]
ld a, [wcc09]
cp $80
jr z, .asm_4126
-.nextTurn
+.next_turn
call SwapTurn
- jr .mainDuelLoop
+ jr .main_duel_loop
.asm_4126
ld a, [wIsPracticeDuel]
or a
- jr z, .nextTurn
+ jr z, .next_turn
ld a, [hl]
cp $f
- jr c, .nextTurn
+ jr c, .next_turn
xor a
ld [wd0c3], a
ret
-.duelFinished
+.duel_finished
call $5990
call Func_04a2
ld a, $3
@@ -143,38 +143,38 @@ StartDuel: ; 409f (1:409f)
call Func_3b21
ld a, [wDuelFinished]
cp DUEL_WON
- jr z, .activeDuelistWonBattle
+ jr z, .active_duelist_won_battle
cp DUEL_LOST
- jr z, .activeDuelistLostBattle
+ jr z, .active_duelist_lost_batte
ld a, $5f
ld c, MUSIC_DARKDIDDLY
ldtx hl, DuelWasDrawText
- jr .handleDuelFinished
+ jr .handle_duel_finished
-.activeDuelistWonBattle
+.active_duelist_won_battle
ldh a, [hWhoseTurn]
cp PLAYER_TURN
- jr nz, .opponentWonBattle
-.playerWonBattle
+ jr nz, .opponent_won_battle
+.player_won_battle
xor a
ld [wd0c3], a
ld a, $5d
ld c, MUSIC_MATCHVICTORY
ldtx hl, WonDuelText
- jr .handleDuelFinished
+ jr .handle_duel_finished
-.activeDuelistLostBattle
+.active_duelist_lost_batte
ldh a, [hWhoseTurn]
cp PLAYER_TURN
- jr nz, .playerWonBattle
-.opponentWonBattle
+ jr nz, .player_won_battle
+.opponent_won_battle
ld a, $1
ld [wd0c3], a
ld a, $5e
ld c, MUSIC_MATCHLOSS
ldtx hl, LostDuelText
-.handleDuelFinished
+.handle_duel_finished
call Func_3b6a
ld a, c
call PlaySong
@@ -189,7 +189,7 @@ StartDuel: ; 409f (1:409f)
jr nz, .asm_41a7
ld a, [wDuelFinished]
cp DUEL_DRAW
- jr z, .tiedBattle
+ jr z, .tied_battle
call Func_39fc
call WaitForWideTextBoxInput
call Func_3b31
@@ -198,7 +198,7 @@ StartDuel: ; 409f (1:409f)
ldh [hWhoseTurn], a
ret
-.tiedBattle
+.tied_battle
call WaitForWideTextBoxInput
call Func_3b31
ld a, [wDuelTheme]
@@ -247,12 +247,12 @@ HandleTurn: ; 4225 (1:4225)
call $70e6
call $4933
call DrawCardFromDeck
- jr nc, .deckNotEmpty
+ jr nc, .deck_not_empty
ld a, DUEL_LOST
ld [wDuelFinished], a
ret
-.deckNotEmpty
+.deck_not_empty
ldh [hTempCardNumber], a
call AddCardToHand
ld a, [wcc0d]
@@ -474,14 +474,14 @@ Func_4436: ; 4436 (1:4436)
PlayerUseEnergyCard: ; 4477 (1:4477)
ld a, c
cp TYPE_ENERGY_WATER ; XXX why treat water energy card differently?
- jr nz, .notWaterEnergy
+ jr nz, .not_water_energy
call $3615
- jr c, .waterEnergy
+ jr c, .water_energy
-.notWaterEnergy
+.not_water_energy
ld a, [wAlreadyPlayedEnergy]
or a
- jr nz, .alreadyPlayedEnergy
+ jr nz, .already_played_energy
call $5fdd
call $600c ; choose card to play energy card on
jp c, Func_426d ; exit if no card was chosen
@@ -501,7 +501,7 @@ PlayerUseEnergyCard: ; 4477 (1:4477)
call $68e4
jp Func_426d
-.waterEnergy
+.water_energy
call $5fdd
call $600c ; choose card to play energy card on
jp c, Func_426d ; exit if no card was chosen
@@ -514,7 +514,7 @@ PlayerUseEnergyCard: ; 4477 (1:4477)
call DrawWideTextBox_WaitForInput
jp Func_4436
-.alreadyPlayedEnergy
+.already_played_energy
ldtx hl, OnlyOneEnergyCardText
call DrawWideTextBox_WaitForInput
call CreateHandCardBuffer
@@ -533,27 +533,27 @@ DuelMenu_Check: ; 4585 (1:4585)
DuelMenu_Attack: ; 46fc (1:46fc)
call HandleCantAttackSubstatus
- jr c, .alertCantAttackAndCancelMenu
+ jr c, .alert_cant_attack_and_cancel_menu
call CheckIfActiveCardParalyzedOrAsleep
- jr nc, .clearSubMenuSelection
+ jr nc, .clear_sub_menu_selection
-.alertCantAttackAndCancelMenu
+.alert_cant_attack_and_cancel_menu
call DrawWideTextBox_WaitForInput
jp PrintDuelMenu
-.clearSubMenuSelection
+.clear_sub_menu_selection
xor a
ld [wSelectedDuelSubMenuItem], a
-.tryOpenAttackMenu
+.try_open_attack_menu
call LoadPokemonMovesToDuelCardOrAttackList
or a
- jr nz, .openAttackMenu
+ jr nz, .open_attack_menu
ldtx hl, NoSelectableAttackText
call DrawWideTextBox_WaitForInput
jp PrintDuelMenu
-.openAttackMenu
+.open_attack_menu
push af
ld a, [wSelectedDuelSubMenuItem]
ld hl, AttackMenuCursorData
@@ -566,23 +566,23 @@ DuelMenu_Attack: ; 46fc (1:46fc)
ld a, [hl]
call LoadDeckCardToBuffer1
-.waitForInput
+.wait_for_input
call DoFrame
ldh a, [hButtonsPressed]
and START
- jr nz, .displaySelectedMoveInfo
+ jr nz, .display_selected_move_info
call HandleMenuInput
- jr nc, .waitForInput
+ jr nc, .wait_for_input
cp $ff ; was B pressed?
jp z, PrintDuelMenu
ld [wSelectedDuelSubMenuItem], a
call CheckIfEnoughEnergies
- jr nc, .enoughEnergy
+ jr nc, .enough_energy
ldtx hl, NotEnoughEnergyCardsText
call DrawWideTextBox_WaitForInput
- jr .tryOpenAttackMenu
+ jr .try_open_attack_menu
-.enoughEnergy
+.enough_energy
ldh a, [hCurrentMenuItem]
add a
ld e, a
@@ -594,7 +594,7 @@ DuelMenu_Attack: ; 46fc (1:46fc)
ld e, [hl] ; attack index (0 or 1)
call CopyMoveDataAndDamageToBuffer
call HandleAmnesiaSubstatus
- jr c, .cannotUseDueToAmnesia
+ jr c, .cannot_use_due_to_amnesia
ld a, $07
call $51e7
jp c, Func_4268
@@ -602,14 +602,14 @@ DuelMenu_Attack: ; 46fc (1:46fc)
jp c, Func_426d
ret
-.cannotUseDueToAmnesia ; 477d (1:477d)
+.cannot_use_due_to_amnesia ; 477d (1:477d)
call DrawWideTextBox_WaitForInput
- jr .tryOpenAttackMenu
+ jr .try_open_attack_menu
-.displaySelectedMoveInfo ; 4782 (1:4782)
+.display_selected_move_info ; 4782 (1:4782)
call Func_478b
call $4f9d
- jp .tryOpenAttackMenu
+ jp .try_open_attack_menu
Func_478b: ; 478b (1:478b)
ld a, $01
@@ -725,7 +725,7 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
ld [wCardPageNumber], a
ld de, wLoadedCard1Move1Name
call CheckIfMoveExists
- jr c, .checkForSecondAttackSlot
+ jr c, .check_for_second_attack_slot
ldh a, [hTempCardNumber]
ld [hli], a
xor a
@@ -741,10 +741,10 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
inc b
inc b
-.checkForSecondAttackSlot
+.check_for_second_attack_slot
ld de, wLoadedCard1Move2Name
call CheckIfMoveExists
- jr c, .finishLoadingAttacks
+ jr c, .finish_loading_attacks
ldh a, [hTempCardNumber]
ld [hli], a
ld a, $01
@@ -758,7 +758,7 @@ LoadPokemonMovesToDuelCardOrAttackList: ; 4823 (1:4823)
pop bc
pop hl
-.finishLoadingAttacks
+.finish_loading_attacks
ld a, c
ret
@@ -771,13 +771,13 @@ CheckIfMoveExists: ; 4872 (1:4872)
inc de
ld a, [de]
or c
- jr z, .returnNoMoveFound
+ jr z, .return_no_move_found
ld hl, wLoadedCard1Move1Category - (wLoadedCard1Move1Name + 1)
add hl, de
ld a, [hl]
and $ff - RESIDUAL
cp POKEMON_POWER
- jr z, .returnNoMoveFound
+ jr z, .return_no_move_found
or a
.return
@@ -786,7 +786,7 @@ CheckIfMoveExists: ; 4872 (1:4872)
pop hl
ret
-.returnNoMoveFound
+.return_no_move_found
scf
jr .return
@@ -829,35 +829,35 @@ _CheckIfEnoughEnergies: ; 48ac (1:48ac)
ld de, wLoadedCard1Move1Energy
ld a, c
or a
- jr z, .gotMove
+ jr z, .got_move
ld de, wLoadedCard1Move2Energy
-.gotMove
+.got_move
ld hl, wLoadedCard1Move1Name - wLoadedCard1Move1Energy
add hl, de
ld a, [hli]
or [hl]
- jr z, .notUsable
+ jr z, .not_usable
ld hl, wLoadedCard1Move1Category - wLoadedCard1Move1Energy
add hl, de
ld a, [hl]
cp POKEMON_POWER
- jr z, .notUsable
+ jr z, .not_usable
xor a
ld [wAttachedEnergiesAccum], a
ld hl, wAttachedEnergies
ld c, (COLORLESS - FIRE) / 2
-.nextEnergyTypePair
+.next_energy_type_pair
ld a, [de]
swap a
call _CheckIfEnoughEnergiesOfType
- jr c, .notEnoughEnergies
+ jr c, .not_enough_energies
ld a, [de]
call _CheckIfEnoughEnergiesOfType
- jr c, .notEnoughEnergies
+ jr c, .not_enough_energies
inc de
dec c
- jr nz, .nextEnergyTypePair
+ jr nz, .next_energy_type_pair
ld a, [de] ; colorless energy
swap a
and $f
@@ -867,14 +867,14 @@ _CheckIfEnoughEnergies: ; 48ac (1:48ac)
ld a, [wTotalAttachedEnergies]
sub c
cp b
- jr c, .notEnoughEnergies
+ jr c, .not_enough_energies
or a
.asm_48fb
pop de
ret
-.notUsable
-.notEnoughEnergies
+.not_usable
+.not_enough_energies
scf
jr .asm_48fb
; 0x4900
@@ -891,16 +891,16 @@ _CheckIfEnoughEnergiesOfType: ; 4900 (1:4900)
ld [hl], a ; accumulate the amount of energies required
pop hl
pop af
- jr z, .enoughEnergies ; jump if no energies of this type are required
+ jr z, .enough_energies ; jump if no energies of this type are required
cp [hl]
; jump if the energies required of this type are not more than the amount attached
- jr z, .enoughEnergies
- jr c, .enoughEnergies
+ jr z, .enough_energies
+ jr c, .enough_energies
inc hl
scf
ret
-.enoughEnergies
+.enough_energies
inc hl
or a
ret
@@ -919,12 +919,12 @@ CheckIfActiveCardParalyzedOrAsleep: ; 4918 (1:4918)
.paralyzed
ldtx hl, UnableDueToParalysisText
- jr .returnWithStatusCondition
+ jr .return_with_status_condition
.asleep
ldtx hl, UnableDueToSleepText
-.returnWithStatusCondition:
+.return_with_status_condition
scf
ret
@@ -1181,12 +1181,12 @@ LoadPlayerDeck: ; 6793 (1:6793)
add hl, de
ld de, wPlayerDeck
ld c, DECK_SIZE
-.nextCardLoop
+.next_card_loop
ld a, [hli]
ld [de], a
inc de
dec c
- jr nz, .nextCardLoop
+ jr nz, .next_card_loop
call DisableExtRAM
ret
; 0x67b2
@@ -1201,14 +1201,14 @@ AIMakeDecision: ; 67be (1:67be)
ld a, [hl]
ld [hl], $0
or a
- jr nz, .skipDelay
-.delayLoop
+ jr nz, .skip_delay
+.delay_loop
call DoFrame
ld a, [wVBlankCtr]
cp $3c
- jr c, .delayLoop
+ jr c, .delay_loop
-.skipDelay
+.skip_delay
ld a, [$ff9e]
ld hl, $cbe1
ld [hl], $0
@@ -1217,7 +1217,7 @@ AIMakeDecision: ; 67be (1:67be)
ld a, [wDuelFinished]
ld hl, $cbe1
or [hl]
- jr nz, .turnEnded
+ jr nz, .turn_ended
ld a, [wcbf9]
or a
ret nz
@@ -1227,7 +1227,7 @@ AIMakeDecision: ; 67be (1:67be)
or a
ret
-.turnEnded
+.turn_ended
scf
ret
; 0x67fb
@@ -1296,23 +1296,23 @@ ConvertTrainerCardToPokemon:
ret z
ld a, e
cp MYSTERIOUS_FOSSIL
- jr nz, .checkForClefairyDoll
+ jr nz, .check_for_clefairy_doll
ld a, d
cp $00
- jr z, .startRamDataOverwrite
+ jr z, .start_ram_data_overwrite
ret
-.checkForClefairyDoll
+.check_for_clefairy_doll
cp CLEFAIRY_DOLL
ret nz
ld a, d
cp $00
ret nz
-.startRamDataOverwrite
+.start_ram_data_overwrite
push de
ld [hl], COLORLESS
ld bc, wLoadedCard1HP - wLoadedCard1
add hl, bc
- ld de, .dataToOverwrite
+ ld de, .data_to_overwrite
ld c, wLoadedCard1Unknown2 - wLoadedCard1HP
.loop
ld a, [de]
@@ -1323,7 +1323,7 @@ ConvertTrainerCardToPokemon:
pop de
ret
-.dataToOverwrite
+.data_to_overwrite
db 10 ; hp
ds $07 ; wLoadedCard1Move1Name - (wLoadedCard1HP + 1)
tx DiscardName ; move1 name
@@ -1349,16 +1349,16 @@ InitializeDuelVariables: ; 7107 (1:7107)
push af
xor a
ld l, a
-.zeroDuelVariablesLoop
+.zero_duel_variables_loop
ld [hl], a
inc l
- jr nz, .zeroDuelVariablesLoop
+ jr nz, .zero_duel_variables_loop
pop af
pop hl
ld [hl], a
lb bc, DUELVARS_CARD_LOCATIONS, DECK_SIZE
ld l, DUELVARS_DECK_CARDS
-.initDuelVariablesLoop
+.init_duel_variables_loop
; zero card locations and cards in hand, and init order of cards in deck
push hl
ld [hl], b
@@ -1368,15 +1368,15 @@ InitializeDuelVariables: ; 7107 (1:7107)
inc l
inc b
dec c
- jr nz, .initDuelVariablesLoop
+ jr nz, .init_duel_variables_loop
ld l, DUELVARS_ARENA_CARD
ld c, 1 + BENCH_SIZE + 1
-.initPlayArea
+.init_play_area
; initialize to $ff card in arena as well as cards in bench (plus a terminator?)
ld [hl], $ff
inc l
dec c
- jr nz, .initPlayArea
+ jr nz, .init_play_area
ret
; 0x7133
diff --git a/src/engine/bank3.asm b/src/engine/bank3.asm
index 563a667..f591863 100755
--- a/src/engine/bank3.asm
+++ b/src/engine/bank3.asm
@@ -772,13 +772,13 @@ AttemptScriptedMovement: ; c619 (3:4619)
push bc
ld a, b
cp $1f
- jr nc, .quitMovement
+ jr nc, .quit_movement
ld a, c
cp $1f
- jr nc, .quitMovement
+ jr nc, .quit_movement
call GetFloorObjectFromPos
and $40 | $80 ; the two impassable objects found in the floor map
- jr nz, .quitMovement
+ jr nz, .quit_movement
ld a, b
ld [wPlayerXCoord], a
ld a, c
@@ -795,7 +795,7 @@ AttemptScriptedMovement: ; c619 (3:4619)
call ModifyUnknownOAMBufferProperty
ld a, $4
ld [hl], a
-.quitMovement
+.quit_movement
pop bc
pop hl
ret
@@ -2981,11 +2981,11 @@ WaterClubMovePlayer: ; e13f (3:613f)
jp Func_c926
WaterClubAfterDuel: ;e157 (3:6157)
- ld hl, .afterDuelTable
+ ld hl, .after_duel_table
call FindEndOfBattleScript
ret
-.afterDuelTable
+.after_duel_table
dw $1f1f
dw OWSequence_BeatSara
dw OWSequence_LostToSara
@@ -3009,11 +3009,11 @@ OWSequence_Sara: ; e177 (3:6177)
tx Text042c
run_script OWScript_AskQuestionJump
tx Text042d
- dw .yesDuel
+ dw .yes_duel
run_script OWScript_PrintTextString
tx Text042e
run_script OWScript_EndScriptCloseText
-.yesDuel
+.yes_duel
run_script OWScript_PrintTextString
tx Text042f
run_script OWScript_StartBattle
@@ -3047,11 +3047,11 @@ OWSequence_Amanda: ; e19e (03:619e)
tx Text0433
run_script OWScript_AskQuestionJump
tx Text0434
- dw .yesDuel
+ dw .yes_duel
run_script OWScript_PrintTextString
tx Text0435
run_script OWScript_EndScriptCloseText
-.yesDuel
+.yes_duel
run_script OWScript_PrintTextString
tx Text0436
run_script OWScript_StartBattle
@@ -3086,20 +3086,20 @@ OWSequence_Joshua:
start_script
run_script OWScript_JumpIfFlagNotSet
db FLAG_BEAT_AMANDA
- dw .saraAndAmandaNotBeaten
+ dw .sara_and_amanda_not_beaten
run_script OWScript_JumpIfFlagNotSet
db FLAG_BEAT_SARA
- dw .saraAndAmandaNotBeaten
+ dw .sara_and_amanda_not_beaten
run_script OWScript_ScriptJump
- dw .beatSaraAndAmanda
-.saraAndAmandaNotBeaten
+ dw .beat_sara_and_amanda
+.sara_and_amanda_not_beaten
run_script OWScript_CustomModifyEventFlags
db $33 ; offset on flagmod table
db $01 ; the control bit
run_script OWScript_PrintTextString
tx Text043b
run_script OWScript_EndScriptCloseText
-.beatSaraAndAmanda
+.beat_sara_and_amanda
run_script OWScript_JumpIfFlagSet
db $33
dw $623c
@@ -3120,23 +3120,23 @@ FindEndOfBattleScript: ; e52c (3:652c)
ld c, $0
ld a, [wd0c3]
or a
- jr z, .playerWon
+ jr z, .player_won
ld c, $2
-.playerWon
+.player_won
ld a, [wd0c4]
ld b, a
ld de, $0005
-.checkEnemyByteLoop
+.check_enemy_byte_loop
ld a, [hli]
or a
ret z
cp b
- jr z, .foundEnemy
+ jr z, .found_enemy
add hl, de
- jr .checkEnemyByteLoop
+ jr .check_enemy_byte_loop
-.foundEnemy
+.found_enemy
ld a, [hli]
ld [wd3ab], a
ld b, $0
diff --git a/src/engine/bank5.asm b/src/engine/bank5.asm
index 3f0e5a2..aeceb86 100755
--- a/src/engine/bank5.asm
+++ b/src/engine/bank5.asm
@@ -59,7 +59,7 @@ PointerTable_14000: ; 14000 (05:4000)
Func_14226: ; 14226 (5:4226)
call CreateHandCardBuffer
ld hl, wDuelCardOrAttackList
-.checkForNextPokemon
+.check_for_next_pokemon
ld a, [hli]
ld [$ff98], a
cp $ff
@@ -67,15 +67,15 @@ Func_14226: ; 14226 (5:4226)
call LoadDeckCardToBuffer1
ld a, [wLoadedCard1Type]
cp TYPE_ENERGY_FIRE
- jr nc, .checkForNextPokemon
+ jr nc, .check_for_next_pokemon
ld a, [wLoadedCard1Stage]
or a
- jr nz, .checkForNextPokemon
+ jr nz, .check_for_next_pokemon
push hl
ld a, [$ff98]
call Func_1485
pop hl
- jr .checkForNextPokemon
+ jr .check_for_next_pokemon
; 0x1424b
INCROM $1424b, $14663
@@ -310,10 +310,10 @@ ZeroData: ; 1575e (5:575e)
push hl
ld b, a
xor a
-.clearLoop
+.clear_loop
ld [hli], a
dec b
- jr nz, .clearLoop
+ jr nz, .clear_loop
pop hl
pop bc
pop af
diff --git a/src/engine/booster_packs.asm b/src/engine/booster_packs.asm
index e3180fe..e955ed0 100644
--- a/src/engine/booster_packs.asm
+++ b/src/engine/booster_packs.asm
@@ -3,11 +3,11 @@ GenerateBoosterPack: ; 1e1c4 (7:61c4)
push bc
push de
ld [wBoosterIndex], a
-.noCardsFoundLoop
+.no_cards_found_loop
call InitBoosterData
call GenerateBoosterEnergies
call GenerateBoosterNonEnergies
- jr c, .noCardsFoundLoop
+ jr c, .no_cards_found_loop
call PutEnergiesAndNonEnergiesTogether
call AddBoosterCardsToCollection
pop de
@@ -19,15 +19,15 @@ GenerateBoosterPack: ; 1e1c4 (7:61c4)
GenerateBoosterNonEnergies: ; 1e1df (7:61df)
ld a, STAR
ld [wBoosterCurRarity], a
-.generateCardLoop
+.generate_card_loop
call FindCurRarityChance
ld a, [hl]
or a
- jr z, .noMoreOfCurrentRarity
+ jr z, .no_more_of_current_rarity
call FindCardsInSetAndRarity
call FindTotalTypeChances
or a
- jr z, .noValidCards
+ jr z, .no_valid_cards
call Random
call DetermineBoosterCardType
call FindBoosterCard
@@ -35,16 +35,16 @@ GenerateBoosterNonEnergies: ; 1e1df (7:61df)
call AddBoosterCardToDrawnNonEnergies
call FindCurRarityChance
dec [hl]
- jr .generateCardLoop
-.noMoreOfCurrentRarity
+ jr .generate_card_loop
+.no_more_of_current_rarity
ld a, [wBoosterCurRarity]
dec a
ld [wBoosterCurRarity], a
bit 7, a ; any rarity left to check?
- jr z, .generateCardLoop
+ jr z, .generate_card_loop
or a
ret
-.noValidCards
+.no_valid_cards
rst $38
scf
ret
@@ -64,22 +64,22 @@ FindCardsInSetAndRarity: ; 1e226 (7:6226)
ld c, NUM_BOOSTER_CARD_TYPES
ld hl, wBoosterAmountOfCardTypeTable
xor a
-.deleteTypeTableLoop
+.delete_type_table_loop
ld [hli], a
dec c
- jr nz, .deleteTypeTableLoop
+ jr nz, .delete_type_table_loop
xor a
ld hl, wBoosterViableCardList
ld [hl], a
ld de, $1
-.checkCardViableLoop
+.check_card_viable_loop
push de
ld a, e
ld [wBoosterTempCard], a
call IsByteInTempCardCollectionZero
- jr c, .finishedWithCurrentCard
+ jr c, .finished_with_current_card
call CheckCardViable
- jr c, .finishedWithCurrentCard
+ jr c, .finished_with_current_card
ld a, [wBoosterCurrentCardType]
call GetCardType
push af
@@ -96,12 +96,12 @@ FindCardsInSetAndRarity: ; 1e226 (7:6226)
ld [hli], a
xor a
ld [hl], a
-.finishedWithCurrentCard
+.finished_with_current_card
pop de
inc e
ld a, e
cp NUM_CARDS + 1
- jr c, .checkCardViableLoop
+ jr c, .check_card_viable_loop
ret
CheckCardViable: ; 1e268 (7:6268)
@@ -117,22 +117,22 @@ CheckCardViable: ; 1e268 (7:6268)
ld c, a
ld a, [wBoosterCurRarity]
cp c
- jr nz, .invalidCard
+ jr nz, .invalid_card
ld a, [wBoosterCurrentCardType]
call GetCardType
cp BOOSTER_CARD_TYPE_ENERGY
- jr z, .returnValidCard
+ jr z, .return_valid_card
ld a, [wBoosterCurrentCardSet]
swap a
and $0f
ld c, a
ld a, [wBoosterDataSet]
cp c
- jr nz, .invalidCard
-.returnValidCard
+ jr nz, .invalid_card
+.return_valid_card
or a
jr .return
-.invalidCard
+.invalid_card
scf
.return
pop bc
@@ -144,11 +144,11 @@ GetCardType: ; 1e2a0 (7:62a0)
push bc
ld hl, CardTypeTable
cp NUM_CARD_TYPES
- jr nc, .loadType
+ jr nc, .load_type
ld c, a
ld b, $00
add hl, bc
-.loadType
+.load_type
ld a, [hl]
pop bc
pop hl
@@ -177,36 +177,36 @@ FindTotalTypeChances: ; 1e2c2 (7:62c2)
ld c, NUM_BOOSTER_CARD_TYPES
xor a
ld hl, wBoosterTempTypeChanceTable
-.deleteTempTypeChanceTableLoop
+.delete_temp_type_chance_table_loop
ld [hli], a
dec c
- jr nz, .deleteTempTypeChanceTableLoop
+ jr nz, .delete_temp_type_chance_table_loop
ld [wd4ca], a
ld bc, $00
-.checkIfTypeIsValid
+.check_if_type_is_valid
push bc
ld hl, wBoosterAmountOfCardTypeTable
add hl, bc
ld a, [hl]
or a
- jr z, .amountOfTypeOrChanceZero
+ jr z, .amount_of_type_or_chance_zero
ld hl, wBoosterDataTypeChances
add hl, bc
ld a, [hl]
or a
- jr z, .amountOfTypeOrChanceZero
+ jr z, .amount_of_type_or_chance_zero
ld hl, wBoosterTempTypeChanceTable
add hl, bc
ld [hl], a
ld a, [wd4ca]
add [hl]
ld [wd4ca], a
-.amountOfTypeOrChanceZero
+.amount_of_type_or_chance_zero
pop bc
inc c
ld a, c
cp NUM_BOOSTER_CARD_TYPES
- jr c, .checkIfTypeIsValid
+ jr c, .check_if_type_is_valid
ld a, [wd4ca]
ret
@@ -214,22 +214,22 @@ DetermineBoosterCardType: ; 1e2fa (7:62fa)
ld [wd4ca], a
ld c, $00
ld hl, wBoosterTempTypeChanceTable
-.loopThroughCardTypes
+.loop_through_card_types
ld a, [hl]
or a
- jr z, .skipNoChanceType
+ jr z, .skip_no_chance_type
ld a, [wd4ca]
sub [hl]
ld [wd4ca], a
- jr c, .foundCardType
-.skipNoChanceType
+ jr c, .found_card_type
+.skip_no_chance_type
inc hl
inc c
ld a, c
cp a, NUM_BOOSTER_CARD_TYPES
- jr c, .loopThroughCardTypes
+ jr c, .loop_through_card_types
ld a, BOOSTER_CARD_TYPE_ENERGY
-.foundCardType
+.found_card_type
ld a, c
ld [wBoosterSelectedCardType], a
ret
@@ -244,26 +244,26 @@ FindBoosterCard: ; 1e31d (7:631d)
call Random
ld [wd4ca], a
ld hl, wBoosterViableCardList
-.findMatchingCardLoop
+.find_matching_card_loop
ld a, [hli]
or a
- jr z, .noValidCardFound
+ jr z, .no_valid_card_found
ld [wBoosterTempCard], a
ld a, [wBoosterSelectedCardType]
cp [hl]
- jr nz, .cardIncorrectType
+ jr nz, .card_incorrect_type
ld a, [wd4ca]
or a
- jr z, .returnWithCurrentCard
+ jr z, .return_with_current_card
dec a
ld [wd4ca], a
-.cardIncorrectType
+.card_incorrect_type
inc hl
- jr .findMatchingCardLoop
-.returnWithCurrentCard
+ jr .find_matching_card_loop
+.return_with_current_card
or a
ret
-.noValidCardFound
+.no_valid_card_found
rst $38
scf
ret
@@ -284,12 +284,12 @@ UpdateBoosterCardTypesChanceByte: ; 1e350 (7:6350)
ld a, [hl]
sub c
ld [hl], a
- jr z, .chanceLessThanOne
- jr nc, .stillSomeChanceLeft
-.chanceLessThanOne
+ jr z, .chance_less_than_one
+ jr nc, .still_some_chance_left
+.chance_less_than_one
ld a, $01
ld [hl], a
-.stillSomeChanceLeft
+.still_some_chance_left
pop bc
pop hl
ret
@@ -300,11 +300,11 @@ GenerateBoosterEnergies: ; 1e3db (7:63db)
ld hl, wBoosterDataEnergyFunctionPointer + 1
ld a, [hld]
or a
- jr z, .noFunctionPointer
+ jr z, .no_function_pointer
ld l, [hl]
ld h, a
jp hl
-.noFunctionPointer
+.no_function_pointer
ld a, [hl]
or a
ret z ; return if no hardcoded energy either
@@ -328,12 +328,12 @@ GenerateEndingEnergy: ; 1e387 (7:6387)
; generates a booster with 10 random energies
GenerateRandomEnergyBooster: ; 1e390 (7:6390)
ld a, NUM_CARDS_IN_BOOSTER
-.generateEnergyLoop
+.generate_energy_loop
push af
call GenerateEndingEnergy
pop af
dec a
- jr nz, .generateEnergyLoop
+ jr nz, .generate_energy_loop
jr ZeroBoosterRarityData
GenerateEnergyBoosterLightningFire: ; 1e39c (7:639c)
@@ -351,9 +351,9 @@ GenerateEnergyBoosterGrassPsychic: ; 1e3a6 (7:63a6)
; generates a booster with 5 energies of 2 different types each
GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab)
ld b, $02
-.addTwoEnergiesToBoosterLoop
+.add_two_energies_to_booster_loop
ld c, NUM_CARDS_IN_BOOSTER / 2
-.addEnergyToBoosterLoop
+.add_energy_to_booster_loop
push hl
push bc
ld a, [hl]
@@ -361,10 +361,10 @@ GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab)
pop bc
pop hl
dec c
- jr nz, .addEnergyToBoosterLoop
+ jr nz, .add_energy_to_booster_loop
inc hl
dec b
- jr nz, .addTwoEnergiesToBoosterLoop
+ jr nz, .add_two_energies_to_booster_loop
ZeroBoosterRarityData:
xor a
ld [wBoosterDataCommonAmount], a
@@ -410,30 +410,30 @@ CopyToFirstEmptyByte: ; 1e3e7 (7:63e7)
PutEnergiesAndNonEnergiesTogether: ; 1e3f3 (7:63f3)
push hl
ld hl, wBoosterTempEnergiesDrawn
-.loopThroughExtraCards
+.loop_through_extra_cards
ld a, [hli]
or a
- jr z, .endOfCards
+ jr z, .end_of_cards
ld [wBoosterTempCard], a
push hl
ld hl, wBoosterTempNonEnergiesDrawn
call CopyToFirstEmptyByte
pop hl
- jr .loopThroughExtraCards
-.endOfCards
+ jr .loop_through_extra_cards
+.end_of_cards
pop hl
ret
AddBoosterCardsToCollection:; 1e40a (7:640a)
push hl
ld hl, wBoosterCardsDrawn
-.addCardsLoop
+.add_cards_loop
ld a, [hli]
or a
- jr z, .noCardsLeft
+ jr z, .no_cards_left
call AddCardToCollection
- jr .addCardsLoop
-.noCardsLeft
+ jr .add_cards_loop
+.no_cards_left
pop hl
ret
@@ -464,17 +464,17 @@ InitBoosterData: ; 1e430 (7:6430)
ld c, wBoosterCardsDrawnEnd - wBoosterCardsDrawn
ld hl, wBoosterCardsDrawn
xor a
-.clearPlayerDeckLoop
+.clear_player_deck_loop
ld [hli], a
dec c
- jr nz, .clearPlayerDeckLoop
+ jr nz, .clear_player_deck_loop
ld c, $00 ; $100
ld hl, wTempCardCollection
xor a
-.clearTempCardCollectionLoop
+.clear_temp_card_collection_loop
ld [hli], a
dec c
- jr nz, .clearTempCardCollectionLoop
+ jr nz, .clear_temp_card_collection_loop
call FindBoosterDataPointer
ld de, wBoosterDataSet
ld bc, wBoosterDataTypeChances - wBoosterDataSet + NUM_BOOSTER_CARD_TYPES ; Pack2 - Pack1
@@ -484,16 +484,16 @@ InitBoosterData: ; 1e430 (7:6430)
ld d, NUM_BOOSTER_CARD_TYPES
ld e, $0
ld hl, wBoosterDataTypeChances
-.addChanceBytesLoop
+.add_chance_bytes_loop
ld a, [hli]
or a
- jr z, .skipChanceByte
+ jr z, .skip_chance_byte
add c
ld c, a
inc e
-.skipChanceByte
+.skip_chance_byte
dec d
- jr nz, .addChanceBytesLoop
+ jr nz, .add_chance_bytes_loop
call DivideBCbyDE
ld a, c
ld [wBoosterAveragedTypeChances], a
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index dc05043..5b9d6ef 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -38,30 +38,30 @@ applyEffect
ldh a, [hWhoseTurn]
ld hl, wcc05
cp [hl]
- jr nz, .canInduceStatus
+ jr nz, .can_induce_status
ld a, [wTempNonTurnDuelistCardId]
cp CLEFAIRY_DOLL
- jr z, .cantInduceStatus
+ jr z, .cant_induce_status
cp MYSTERIOUS_FOSSIL
- jr z, .cantInduceStatus
+ jr z, .cant_induce_status
; snorlax's thick skinned prevents it from being statused...
cp SNORLAX
- jr nz, .canInduceStatus
+ jr nz, .can_induce_status
call SwapTurn
xor a
; ...unless already so, or if affected by muk's toxic gas
call CheckIfUnderAnyCannotUseStatus2
call SwapTurn
- jr c, .canInduceStatus
+ jr c, .can_induce_status
-.cantInduceStatus
+.cant_induce_status
ld a, c
ld [wccf1], a
call Func_2c09c
or a
ret
-.canInduceStatus
+.can_induce_status
ld hl, wcccd
push hl
ld e, [hl]
@@ -101,7 +101,7 @@ Func_2c087: ; 2c087 (b:4087)
xor a
jr asm_2c08c
-Func_2c08a: ; 2c08a (b:408a)
+Func_2c08a: ; 2c08a (b:408a)
ld a, $1
asm_2c08c
@@ -143,7 +143,7 @@ Func_2c0d4: ; 2c0d4 (b:40d4)
ld a, DUELVARS_ARENA_CARD_STATUS
call GetNonTurnDuelistVariable
and DOUBLE_POISONED
- jr z, .notDoublePoisoned
+ jr z, .not_double_poisoned
pop af
ld a, [wDamage]
ld [wccbb], a
@@ -152,7 +152,7 @@ Func_2c0d4: ; 2c0d4 (b:40d4)
push af
-.notDoublePoisoned
+.not_double_poisoned
ld hl, wDamage
ld a, [hl]
add d
@@ -198,7 +198,7 @@ ApplySubstatus1ToDefendingCard: ; 2c140 (b:4140)
ApplySubstatus2ToDefendingCard: ; 2c149 (b:4149)
push af
call CheckNoDamageOrEffect
- jr c, .noDamageOrEffect
+ jr c, .no_damage_orEffect
ld a, DUELVARS_ARENA_CARD_SUBSTATUS2
call GetNonTurnDuelistVariable
pop af
@@ -207,7 +207,7 @@ ApplySubstatus2ToDefendingCard: ; 2c149 (b:4149)
ld [hl], a
ret
-.noDamageOrEffect
+.no_damage_orEffect
pop af
push hl
bank1call $4f9d
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 2f57dce..b572b07 100755
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -1781,7 +1781,7 @@ DetectSGB: ; 0b59 (0:0b59)
ld a, [rJOYP]
and $3
cp $3
- jr nz, .asm_ba3
+ jr nz, .sgb
ld a, $20
ld [rJOYP], a
ld a, [rJOYP]
@@ -1804,12 +1804,12 @@ DetectSGB: ; 0b59 (0:0b59)
ld a, [rJOYP]
and $3
cp $3
- jr nz, .asm_ba3
+ jr nz, .sgb
ld hl, SGB_MLT_REQ_1
call SendSGB
or a
ret
-.asm_ba3
+.sgb
ld hl, SGB_MLT_REQ_1
call SendSGB
scf
@@ -2951,11 +2951,11 @@ GetAttachedEnergies: ; 159f (0:159f)
ld hl, wAttachedEnergies
ld c, NUM_TYPES
xor a
-.sumAttachedEnergiesLoop
+.sum_attached_energies_loop
add [hl]
inc hl
dec c
- jr nz, .sumAttachedEnergiesLoop
+ jr nz, .sum_attached_energies_loop
ld [hl], a ; save to wTotalAttachedEnergies
pop bc
pop de
@@ -6752,11 +6752,11 @@ HandleAmnesiaSubstatus: ; 33e1 (0:33e1)
ret
.check_amnesia
cp SUBSTATUS2_AMNESIA
- jr z, .affectedByAmnesia
+ jr z, .affected_by_amnesia
.not_the_disabled_move
or a
ret
-.affectedByAmnesia
+.affected_by_amnesia
ld a, DUELVARS_ARENA_CARD_DISABLED_MOVE_INDEX
call GetTurnDuelistVariable
ld a, [wSelectedMoveIndex]