Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
238 lines
6.3 KiB
PHP
238 lines
6.3 KiB
PHP
BeginMerchant3D PROC
|
|
call LoadArrivalAssets3D
|
|
mov engineMode, MODE_SHOP
|
|
mov merchantTime3D, 0
|
|
mov merchantReaction3D, 1280
|
|
mov merchantMessage3D, 0
|
|
mov eax, selectedBack3D
|
|
cmp eax, 12
|
|
jbe @F
|
|
xor eax, eax
|
|
@@:
|
|
mov merchantSelected3D, eax
|
|
mov merchantPreviousFocus3D, eax
|
|
call ClearKeys3D
|
|
ret
|
|
BeginMerchant3D ENDP
|
|
|
|
BuyMerchantBack3D PROC uses ebx style:DWORD
|
|
mov ebx, style
|
|
cmp ebx, 12
|
|
ja merchant_purchase_done
|
|
bt ownedBacks3D, ebx
|
|
jc merchant_equip
|
|
mov eax, merchantPrices3D[ebx*4]
|
|
cmp bankroll, eax
|
|
jb merchant_purchase_poor
|
|
sub bankroll, eax
|
|
bts ownedBacks3D, ebx
|
|
; Keep the existing shopper achievement bit without opening a console popup.
|
|
cmp nativeProfileActive3D, 0
|
|
je merchant_equip
|
|
or achievements, 10h
|
|
merchant_equip:
|
|
mov selectedBack3D, ebx
|
|
mov merchantMessage3D, 1
|
|
mov merchantReaction3D, 0
|
|
mov merchantReactionKind3D, 2
|
|
call SaveProgress3D
|
|
invoke PlayCasinoSound3D, OFFSET soundClick, 0, 1
|
|
ret
|
|
merchant_purchase_poor:
|
|
mov merchantMessage3D, 2
|
|
mov merchantReaction3D, 0
|
|
mov merchantReactionKind3D, 1
|
|
merchant_purchase_done:
|
|
ret
|
|
BuyMerchantBack3D ENDP
|
|
|
|
HandleMerchant3D PROC uses ebx
|
|
mov eax, merchantSelected3D
|
|
cmp eax, merchantPreviousFocus3D
|
|
je @F
|
|
mov merchantPreviousFocus3D, eax
|
|
mov merchantReaction3D, 0
|
|
mov merchantReactionKind3D, 1
|
|
@@:
|
|
mov eax, deltaTime3D
|
|
add merchantTime3D, eax
|
|
add merchantReaction3D, eax
|
|
invoke Pressed3D, 26h
|
|
test eax, eax
|
|
jz @F
|
|
cmp merchantSelected3D, 0
|
|
je @F
|
|
dec merchantSelected3D
|
|
@@:
|
|
invoke Pressed3D, 28h
|
|
test eax, eax
|
|
jz @F
|
|
cmp merchantSelected3D, 12
|
|
jae @F
|
|
inc merchantSelected3D
|
|
@@:
|
|
cmp mouseClick3D, 0
|
|
je merchant_enter
|
|
cmp mouseX3D, 168
|
|
jb merchant_enter
|
|
cmp mouseX3D, 311
|
|
jae merchant_enter
|
|
cmp mouseY3D, 48
|
|
jae merchant_mouse_rows
|
|
cmp mouseY3D, 34
|
|
jb merchant_enter
|
|
cmp mouseX3D, 248
|
|
jb merchant_enter
|
|
cmp mouseX3D, 278
|
|
jae merchant_mouse_next
|
|
cmp merchantSelected3D, 0
|
|
je merchant_handle_done
|
|
dec merchantSelected3D
|
|
ret
|
|
merchant_mouse_next:
|
|
cmp merchantSelected3D, 12
|
|
jae merchant_handle_done
|
|
inc merchantSelected3D
|
|
ret
|
|
merchant_mouse_rows:
|
|
mov eax, mouseY3D
|
|
sub eax, 52
|
|
js merchant_handle_done
|
|
cmp eax, 130
|
|
jae merchant_mouse_buy
|
|
xor edx, edx
|
|
mov ecx, 26
|
|
div ecx
|
|
mov ebx, eax
|
|
mov eax, merchantSelected3D
|
|
xor edx, edx
|
|
mov ecx, 5
|
|
div ecx
|
|
imul eax, 5
|
|
add eax, ebx
|
|
cmp eax, 12
|
|
ja merchant_handle_done
|
|
mov merchantSelected3D, eax
|
|
ret
|
|
merchant_mouse_buy:
|
|
cmp mouseY3D, 193
|
|
jb merchant_handle_done
|
|
cmp mouseY3D, 211
|
|
ja merchant_handle_done
|
|
jmp merchant_confirm
|
|
merchant_enter:
|
|
invoke Pressed3D, 0Dh
|
|
test eax, eax
|
|
jz merchant_handle_done
|
|
merchant_confirm:
|
|
invoke BuyMerchantBack3D, merchantSelected3D
|
|
merchant_handle_done:
|
|
ret
|
|
HandleMerchant3D ENDP
|
|
|
|
RenderMerchant3D PROC uses ebx esi edi
|
|
local rowY:DWORD,start:DWORD,frame:DWORD,ink:DWORD
|
|
invoke DrawBox, 0, 0, 320, 240, 00252B24h
|
|
invoke DrawBox, 0, 21, 320, 7, 00836638h
|
|
invoke DrawBox, 0, 151, 320, 63, 003C3024h
|
|
invoke DrawAnimSprite3D, OFFSET propsPack3D, 4, 8, 111, 298, 298
|
|
mov frame, 0
|
|
cmp merchantReaction3D, 1280
|
|
jae merchant_idle_pose
|
|
mov eax, merchantReaction3D
|
|
xor edx, edx
|
|
mov ecx, 160
|
|
div ecx
|
|
add eax, 16
|
|
cmp merchantReactionKind3D, 2
|
|
jne @F
|
|
sub eax, 8
|
|
@@:
|
|
mov frame, eax
|
|
jmp merchant_draw_pose
|
|
merchant_idle_pose:
|
|
mov eax, merchantTime3D
|
|
xor edx, edx
|
|
mov ecx, 5400
|
|
div ecx
|
|
cmp edx, 3640
|
|
jb merchant_draw_pose
|
|
mov eax, edx
|
|
sub eax, 3640
|
|
xor edx, edx
|
|
mov ecx, 220
|
|
div ecx
|
|
mov frame, eax
|
|
merchant_draw_pose:
|
|
invoke DrawAnimSprite3D, OFFSET merchantPack3D, frame, -10, 66, 342, 342
|
|
invoke DrawBox, 0, 194, 162, 29, 0045372Ah
|
|
invoke DrawBox, 0, 192, 162, 3, 00B79B63h
|
|
mov esi, OFFSET merchantHello3D
|
|
cmp merchantMessage3D, 1
|
|
jne @F
|
|
mov esi, OFFSET merchantThanks3D
|
|
@@:
|
|
invoke DrawString8x8, 6, 209, esi, 00F0D7ABh
|
|
invoke DrawAnimSprite3D, OFFSET backsPack3D, merchantSelected3D, 24, 282, 68, 96
|
|
invoke DrawBox, 0, 0, 320, 21, 00181D1Bh
|
|
invoke DrawString8x8, 8, 6, OFFSET merchantTitle3D, 00E9CD9Ah
|
|
invoke DrawString8x8, 152, 6, OFFSET textBank3D, 00B8D5B3h
|
|
invoke FormatNumber, bankroll, OFFSET hudNumBuffer
|
|
invoke DrawString8x8, 203, 6, OFFSET hudNumBuffer, 00FFFFFFh
|
|
invoke DrawBoxBorder, 166, 31, 147, 187, 00191D1Fh, 009A825Ah, 1
|
|
invoke DrawString8x8, 173, 36, OFFSET merchantStock3D, 00E9CD9Ah
|
|
invoke DrawBoxBorder, 248, 34, 24, 12, 00373F3Bh, 00889985h, 1
|
|
invoke DrawString8x8, 256, 36, OFFSET merchantArrowUp3D, 00FFFFFFh
|
|
invoke DrawBoxBorder, 279, 34, 24, 12, 00373F3Bh, 00889985h, 1
|
|
invoke DrawString8x8, 287, 36, OFFSET merchantArrowDown3D, 00FFFFFFh
|
|
mov eax, merchantSelected3D
|
|
xor edx, edx
|
|
mov ecx, 5
|
|
div ecx
|
|
imul eax, 5
|
|
mov start, eax
|
|
mov ebx, eax
|
|
mov rowY, 52
|
|
merchant_render_row:
|
|
cmp ebx, 12
|
|
ja merchant_render_footer
|
|
mov ink, 00C1C8C1h
|
|
cmp ebx, merchantSelected3D
|
|
jne @F
|
|
invoke DrawBoxBorder, 169, rowY, 140, 24, 00395046h, 00A7C4AEh, 1
|
|
mov ink, 00FFFFFFh
|
|
@@:
|
|
mov eax, rowY
|
|
add eax, 3
|
|
invoke DrawString8x8, 173, eax, merchantNames3D[ebx*4], ink
|
|
mov esi, OFFSET merchantOwned3D
|
|
cmp ebx, selectedBack3D
|
|
jne @F
|
|
mov esi, OFFSET merchantEquipped3D
|
|
jmp merchant_item_status
|
|
@@:
|
|
bt ownedBacks3D, ebx
|
|
jc merchant_item_status
|
|
invoke FormatNumber, merchantPrices3D[ebx*4], OFFSET hudNumBuffer
|
|
mov esi, OFFSET hudNumBuffer
|
|
merchant_item_status:
|
|
mov eax, rowY
|
|
add eax, 14
|
|
invoke DrawString8x8, 173, eax, esi, 00C7B58Ah
|
|
add rowY, 26
|
|
inc ebx
|
|
mov eax, ebx
|
|
sub eax, start
|
|
cmp eax, 5
|
|
jb merchant_render_row
|
|
merchant_render_footer:
|
|
cmp merchantMessage3D, 2
|
|
jne @F
|
|
invoke DrawString8x8, 172, 182, OFFSET merchantPoor3D, 00EA8A77h
|
|
@@:
|
|
invoke DrawBoxBorder, 171, 194, 136, 17, 003B5949h, 00CBAF73h, 1
|
|
invoke DrawString8x8, 194, 199, OFFSET merchantBuy3D, 00FFFFFFh
|
|
invoke DrawBox, 0, 224, 320, 16, 00181D1Bh
|
|
invoke DrawString8x8, 8, 229, OFFSET merchantShopKeys3D, 00C5C7B8h
|
|
ret
|
|
RenderMerchant3D ENDP
|