diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/bank02.asm | 90 | ||||
-rw-r--r-- | src/text/text2.asm | 6 | ||||
-rw-r--r-- | src/text/text_offsets.asm | 6 |
3 files changed, 94 insertions, 8 deletions
diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index d11ed8b..86acc6d 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -137,8 +137,84 @@ OpenDuelScreen: ; 809e (2:409e) ldh [hWhoseTurn], a ret +; handles the menu when in the Opponent's Play Area submenu +; if clairvoyance is active, add the option to check +; opponent's hand DuelCheckMenu_OppPlayArea: ; 80da (2:40da) - INCROM $80da, $8158 + call ResetCursorPosAndBlink + call IsClairvoyanceActive + jr c, .clairvoyance1 + + ld a, $80 + ld [wce5e], a + jr .begin +.clairvoyance1 + xor a + ld [wce5e], a + +.begin + ldh a, [hWhoseTurn] +.turns + ld l, a + cp PLAYER_TURN + jr nz, .opponent + ld a, OPPONENT_TURN + ld h, a + jr .cursor +.opponent + ld a, PLAYER_TURN + ld h, a + +.cursor + call LoadTurnHolders + ld a, [wCursorDuelYPosition] + sla a + ld b, a + ld a, [wCursorDuelXPosition] + add b + add $03 + ld [wLastCursorPosition_YourPlayArea], a + + ld b, $f8 ; black arrow tile + call DrawByteToTabulatedPositions + call DrawWideTextBox + + xor a + ld [wDuelCursorBlinkCounter], a + + call IsClairvoyanceActive + jr c, .clairvoyance2 + ld hl, OppPlayAreaMenuData + call PlaceTextItems + jr .loop +.clairvoyance2 + ld hl, OppPlayAreaMenuData_WithClairvoyance + call PlaceTextItems + +.loop + call DoFrame + ld a, $01 + call DrawArrowsToTabulatedPositions + call Func_86ac + jr nc, .loop + + call EraseByteFromTabulatedPositions + cp $ff + ret z + + ld a, [wCursorDuelYPosition] + sla a + ld b, a + ld a, [wCursorDuelXPosition] + add b + ld hl, .table + call JumpToFunctionInTable + jr .turns + +.table + dw OpenDuelScreen.non_turn_holder_play_area + dw OpenDuelScreen.non_turn_holder_hand + dw OpenDuelScreen.non_turn_holder_discard_pile CheckMenuData: ; (2:4158) textitem 2, 14, InPlayAreaText @@ -153,7 +229,16 @@ YourPlayAreaMenuData: ; (2:4169) textitem 2, 16, YourDiscardPileText2 db $ff - INCROM $8176, $818c +OppPlayAreaMenuData: ; (2:4176) + textitem 2, 14, OpponentsPokemonText + textitem 2, 16, OpponentsDiscardPileText2 + db $ff + +OppPlayAreaMenuData_WithClairvoyance: ; (2:4176) + textitem 2, 14, OpponentsPokemonText + textitem 12, 14, OpponentsHandText + textitem 2, 16, OpponentsDiscardPileText2 + db $ff ; checks if arrows need to be erased in Play Area ; and draws new arrows upon cursor position change @@ -198,6 +283,7 @@ EraseByteFromTabulatedPositions: ; 81af (2:41af) ; cursor x and y positions in a ; input: ; a = cursor position (2*y + x) +; b = byte to draw DrawByteToTabulatedPositions: ; 81ba (2:41ba) push bc ld hl, PlayAreaDrawPositionsPointerTable diff --git a/src/text/text2.asm b/src/text/text2.asm index 07c0da8..3c46d8d 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -1731,15 +1731,15 @@ Text0242: ; 3bc36 (e:7c36) text "To Your Play Area" done -Text0243: ; 3bc49 (e:7c49) +OpponentsPokemonText: ; 3bc49 (e:7c49) text "Opponent's Pokémon" done -Text0244: ; 3bc5d (e:7c5d) +OpponentsDiscardPileText2: ; 3bc5d (e:7c5d) text "Opponent's Discard Pile" done -Text0245: ; 3bc76 (e:7c76) +OpponentsHandText: ; 3bc76 (e:7c76) text "Opponent Hand" done diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm index 4787481..f8c547d 100644 --- a/src/text/text_offsets.asm +++ b/src/text/text_offsets.asm @@ -580,9 +580,9 @@ TextOffsets:: ; 34000 (d:4000) textpointer YourDiscardPileText2 ; 0x0240 textpointer YourHandText ; 0x0241 textpointer Text0242 ; 0x0242 - textpointer Text0243 ; 0x0243 - textpointer Text0244 ; 0x0244 - textpointer Text0245 ; 0x0245 + textpointer OpponentsPokemonText ; 0x0243 + textpointer OpponentsDiscardPileText2 ; 0x0244 + textpointer OpponentsHandText ; 0x0245 textpointer Text0246 ; 0x0246 textpointer Text0247 ; 0x0247 textpointer YourPlayAreaText ; 0x0248 |