aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2025-05-10 12:25:27 -0500
committerdannye <33dannye@gmail.com>2025-05-10 12:25:27 -0500
commit2c74f137fc42cf7eaffa0a6f9046e4aa89887f91 (patch)
treec52fc10a17597a1d04b63b79c6df78cc1b00de41 /engine/events
parentFix hardcoded address in VC patch (diff)
parentUse features new to RGBDS 0.9.2 (#506) (diff)
downloadpokeyellow-2c74f137fc42cf7eaffa0a6f9046e4aa89887f91.tar.gz
pokeyellow-2c74f137fc42cf7eaffa0a6f9046e4aa89887f91.tar.xz
pokeyellow-2c74f137fc42cf7eaffa0a6f9046e4aa89887f91.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/events')
-rw-r--r--engine/events/heal_party.asm2
-rw-r--r--engine/events/in_game_trades.asm29
-rw-r--r--engine/events/prize_menu.asm11
3 files changed, 28 insertions, 14 deletions
diff --git a/engine/events/heal_party.asm b/engine/events/heal_party.asm
index 8bf162a7..e6551bcd 100644
--- a/engine/events/heal_party.asm
+++ b/engine/events/heal_party.asm
@@ -50,7 +50,7 @@ HealParty:
push bc
ld b, a
ld a, [hl]
- and $c0
+ and PP_UP_MASK
add b
ld [hl], a
pop bc
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index 7ba5fe51..3671dba8 100644
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -1,3 +1,12 @@
+; TradeTextPointers1-3 indexes
+ const_def
+ const TRADETEXT_WANNA_TRADE ; 0
+ const TRADETEXT_NO_TRADE ; 1
+ const TRADETEXT_WRONG_MON ; 2
+ const TRADETEXT_THANKS ; 3
+ const TRADETEXT_AFTER_TRADE ; 4
+DEF NUM_TRADE_TEXTS EQU const_value
+
DoInGameTradeDialogue:
; trigger the trade offer/action specified by wWhichTrade
call SaveScreenTilesToBuffer2
@@ -30,7 +39,7 @@ DoInGameTradeDialogue:
ld a, [wInGameTradeReceiveMonSpecies]
ld de, wInGameTradeReceiveMonName
call InGameTrade_GetMonName
- ld a, $4
+ ld a, TRADETEXT_AFTER_TRADE
ld [wInGameTradeTextPointerTableIndex], a
ld b, FLAG_TEST
call InGameTrade_FlagActionPredef
@@ -38,10 +47,10 @@ DoInGameTradeDialogue:
and a
jr nz, .printText
; if the trade hasn't been done yet
- ld a, $0
+ ld a, TRADETEXT_WANNA_TRADE
ld [wInGameTradeTextPointerTableIndex], a
call .printText
- ld a, $1
+ ld a, TRADETEXT_NO_TRADE
ld [wInGameTradeTextPointerTableIndex], a
call YesNoChoice
ld a, [wCurrentMenuItem]
@@ -87,13 +96,13 @@ InGameTrade_DoTrade:
push af
call InGameTrade_RestoreScreen
pop af
- ld a, $1
+ ld a, TRADETEXT_NO_TRADE
jp c, .tradeFailed ; jump if the player didn't select a pokemon
ld a, [wInGameTradeGiveMonSpecies]
ld b, a
ld a, [wCurPartySpecies]
cp b
- ld a, $2
+ ld a, TRADETEXT_WRONG_MON
jr nz, .tradeFailed ; jump if the selected mon's species is not the required one
ld a, [wWhichPokemon]
ld hl, wPartyMon1Level
@@ -131,7 +140,7 @@ InGameTrade_DoTrade:
call InGameTrade_RestoreScreen
farcall RedrawMapView
and a
- ld a, $3
+ ld a, TRADETEXT_THANKS
jr .tradeSucceeded
.tradeFailed
scf
@@ -254,30 +263,38 @@ InGameTrade_TrainerString:
InGameTradeTextPointers:
; entries correspond to TRADE_DIALOGSET_* constants
+ table_width 2
dw TradeTextPointers1
dw TradeTextPointers2
dw TradeTextPointers3
+ assert_table_length NUM_TRADE_DIALOGSETS
TradeTextPointers1:
+ table_width 2
dw WannaTrade1Text
dw NoTrade1Text
dw WrongMon1Text
dw Thanks1Text
dw AfterTrade1Text
+ assert_table_length NUM_TRADE_TEXTS
TradeTextPointers2:
+ table_width 2
dw WannaTrade2Text
dw NoTrade2Text
dw WrongMon2Text
dw Thanks2Text
dw AfterTrade2Text
+ assert_table_length NUM_TRADE_TEXTS
TradeTextPointers3:
+ table_width 2
dw WannaTrade3Text
dw NoTrade3Text
dw WrongMon3Text
dw Thanks3Text
dw AfterTrade3Text
+ assert_table_length NUM_TRADE_TEXTS
ConnectCableText:
text_far _ConnectCableText
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index 4b2121f5..8701e351 100644
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -125,18 +125,15 @@ GetPrizeMenuId:
; put prices on the right side of the textbox
ld de, wPrize1Price
hlcoord 13, 5
-; reg. c:
-; [low nybble] number of bytes
-; [bits 765 = %100] space-padding (not zero-padding)
- ld c, (1 << 7) | 2
+ ld c, 2 | LEADING_ZEROES
call PrintBCDNumber
ld de, wPrize2Price
hlcoord 13, 7
- ld c, (1 << 7) | 2
+ ld c, 2 | LEADING_ZEROES
call PrintBCDNumber
ld de, wPrize3Price
hlcoord 13, 9
- ld c, (1 << 7) | 2
+ ld c, 2 | LEADING_ZEROES
jp PrintBCDNumber
NoThanksText:
@@ -157,7 +154,7 @@ PrintPrizePrice:
call PlaceString
hlcoord 13, 1
ld de, wPlayerCoins
- ld c, %10000010
+ ld c, 2 | LEADING_ZEROES
call PrintBCDNumber
ret