summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElectroDeoxys <ElectroDeoxys@gmail.com>2019-09-09 23:21:26 +0100
committerElectroDeoxys <ElectroDeoxys@gmail.com>2019-09-09 23:21:26 +0100
commit37af0eac26585f6a38582bbc0ab8459e2387543d (patch)
tree5dbde12f68289201189d1b91f24f9368dc9ba9cb /src
parent35859ec72f645affa3cfc0e6eae6e5327e03c62e (diff)
Disassemble and label CheckIfAnyBasicPokemonInDeck
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank05.asm35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/engine/bank05.asm b/src/engine/bank05.asm
index 3b790f0..0385820 100644
--- a/src/engine/bank05.asm
+++ b/src/engine/bank05.asm
@@ -4986,7 +4986,7 @@ Func_16dcd: ; 16dcd (5:6dcd)
ret
.asm_16ead: ; 16ead (5:6ead)
- call Func_17057
+ call CheckIfAnyBasicPokemonInDeck
jr nc, .done
ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
call GetTurnDuelistVariable
@@ -5209,8 +5209,37 @@ Func_17005: ; 17005 (5:7005)
Func_17019 ; 17019 (5:7019)
INCROM $17019, $17057
-Func_17057 ; 17057 (5:7057)
- INCROM $17057, $17080
+; returns carry if there are
+; any basic Pokémon cards in deck.
+CheckIfAnyBasicPokemonInDeck: ; 17057 (5:7057)
+ ld e, 0
+.loop
+ ld a, DUELVARS_CARD_LOCATIONS
+ add e
+ call GetTurnDuelistVariable
+ cp CARD_LOCATION_DECK
+ jr nz, .next
+ push de
+ ld a, e
+ call LoadCardDataToBuffer2_FromDeckIndex
+ pop de
+ ld a, [wLoadedCard2Type]
+ cp TYPE_ENERGY
+ jr nc, .next
+ ld a, [wLoadedCard2Stage]
+ or a
+ jr z, .set_carry
+.next
+ inc e
+ ld a, DECK_SIZE
+ cp e
+ jr nz, .loop
+ or a
+ ret
+.set_carry
+ scf
+ ret
+; 0x17080
Func_17080 ; 17080 (5:7080)
INCROM $17080, $170c9